[Fixed]-TypeError('view must be a callable or a list/tuple in the case of include().')

1👍

✅

String reference is deprecated in Django 1.10.
So, Django 1.10 no longer allows you to specify views as a string in your URL patterns.
You can no longer pass import paths to url(), you need to pass the actual view function.
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.

Use these urls.py instead :

from django.conf.urls import url,include
from django.contrib import admin
from mysite.views import first_page

urlpatterns = [
    url(r'^admin/',include(admin.site.urls)),
    url(r'^website/$',first_page)
]

Leave a comment