settings.TEMPLATES['context_processors'].append('path.to.my.module.where.inject_form')
def inject_form(request):
return {form: MyForm()}
{# base.html #}
...
{{form}} и вот это всё
...
Article.objects.annotate(avg_rating=Avg('rating__star')).filter(avg_rating__gte=3)
App.objects.prefetch_related(Prefetch('rating_set', queryset=Rating.objects.filter(user=self.request.user))
app.rating_set[0].star