28👍
✅
You are mixing up URL prefixes in your urlpatterns
.
urlpatterns = patterns('karma.views',
(r'^$', 'homepage'),
(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
(r"^opportunities/nearby$", 'draw_map'),
)
Django tries to find views relative to the given URL prefix, in your case 'karma.views'
. Inside this module, there is no 'django.contrib.auth.views.logout'
, hence you get the ImportError
.
Move the logout URL to a second block, e.g.:
urlpatterns += patterns('',
(r'^logout/$', 'django.contrib.auth.views.logout', {'next_page': '/'}),
)
That should resolve your issue.
Source:stackexchange.com