python - Django Haystack Reverse URL Failing -
python - Django Haystack Reverse URL Failing -
i trying configure barebones possible setup django haystack. in html, have form resolves url using named url pattern. here html code.
<form id="search-ticket-form" class="navbar-form navbar-left dropdown" method="get" action="{% url "search_ticket" %}" role="search">
django returns error every time saying "reverse 'search_ticket' arguments '()' , keyword arguments '{}' not found. 0 pattern(s) tried: []"
here configuration in urls.py:
urlpatterns = patterns('', url(r'^$', contact.views.home, name='homepage'), #url(r'^blog/', include('zinnia.urls', namespace='zinnia')), url(r'^profile/', include('user_profile.urls')), url(r'^registration/', include('registration.urls')), url(r'^comments/', include('django_comments.urls')), url(r'^contact/', include('contact.urls')), url(r'^tickets/', include('tickets.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^search/', include('haystack.urls')), ) + static(settings.static_url, document_root=settings.static_root)
here configuration in tickets/urls.py:
urlpatterns = patterns('', url(r'submit_ticket/$', submit_ticket, name='submit_ticket'), url(r'search_ticket/$', include('haystack.urls'), name='search_ticket') )
the setup looks fine. when substitute include('haystack.urls') function based view named 'abc', url resolves fine. makes me think wrong django haystack setup, error misleading. here single haystack view looks like:
class ticketindex(indexes.basicsearchindex, indexes.indexable): def get_model(self): homecoming ticket
i modeled setup after barebones illustration in haystack's github repo (https://github.com/toastdriven/django-haystack/blob/master/example_project/bare_bones_app/search_indexes.py).
any thoughts on going on here?
can name included url tree? includes multiple url patterns. looking @ haystack.urls may want seek {% url "haystack_search"%}
.
python django
Comments
Post a Comment