1👍
The safest solution is to use a custom templatetag – preferably an inclusion tag (https://docs.djangoproject.com/en/1.6/howto/custom-template-tags/#inclusion-tags) so you don’t override other views’s context (since using 'form'
as a context variable is the common practice for views handling a form).
You may still have to roll your own search view (based on the default one) to make the whole thing work as you want…
Source:stackexchange.com