Fixing search url for django 1.10 and above.

For django 1.10 and above the search url will fail with a TypeError since there is no support for views as string insider urlpatterns, It will raise TypeError('view must be a callable or a list/tuple in the case of include().')
TypeError: view must be a callable or a list/tuple in the case of include().
pull/4163/head
misraX 2017-12-31 00:20:26 +02:00 zatwierdzone przez Matt Westcott
rodzic cca7653839
commit c48a2ef501
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -90,7 +90,7 @@ This feature is enabled through the project's root URL configuration. Just put t
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.core import urls as wagtail_urls
from search import views as search_views
urlpatterns = [
url(r'^django-admin/', include(admin.site.urls)),
@ -103,7 +103,7 @@ This feature is enabled through the project's root URL configuration. Just put t
urlpatterns += i18n_patterns(
# These URLs will have /<language_code>/ appended to the beginning
url(r'^search/$', 'search.views.search', name='search'),
url(r'^search/$', search_views.search, name='search'),
url(r'', include(wagtail_urls)),
)