Yes, this is what template context processors are useful for. They allow you to pass a variable to all of your templates without specifying.
settings.py
TEMPLATE_CONTEXT_PROCESSORS = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.debug', ... 'some_app.context_processors.search_form', )
context_processors.py (you place this in one of your applications or in the main directory, if you want)
from my_forms import MySearchForm def search_form(request): return { 'search_form' : MySearchForm() }
Now you can use {{search_form }} in all your templates
source share