[Fixed]-Views must be a callable or a list\tuple in case of include

1👍

Django 1.10+ no longer allows you to specify views as a string (e.g. ‘myapp.views.home’) in your URL patterns.

The solution is to update your urls.py to include the view callable. This means that you have to import the view in your urls.py. If your URL patterns don’t have names, then now is a good time to add one, because reversing with the dotted python path no longer works.

urlpatterns = [
        #previous login view
        #url(r'^login/$', views.user_login, name='login'),
        #login/logout urls
        url(r'^$', views.dashboard, name='dashboard'),

        url(r'^login/$', your_app_name.views.user_login, name='login'),
        url(r'^logout/$', django.contrib.auth.views.logout, name='logout'),
        url(r'^logout-thenlogin/$', django.contrib.auth.views.logout_then_login, 
            name='logout_then_login'),

]

Leave a comment