I need to place a form in all my subsites and home page. It's placed on right column. It's action is "/"
. If there are some errors I must display them.
I made Form class etc. I display it v开发者_如何学运维ia {{ form.as_p }}
and designed all.
The problem is - how to put it on all sites? I don't want to make form instance in all my views functions.
What is the best solution for that?
Looks like a work for a context processor. :-)
def my_form_processor(request):
return {'my_form': MyForm()}
精彩评论