35👍
The error line is
url(r'^$', views.index, name='index'),
#----------^
Here views
is not defined, hence the error. You need to import it from your app.
in urls.py add line
from <your_app> import views
# replace <your_app> with your application name.
1👍
from .views import index
- here we have to import views model classes on urls model so above sentence import your view model class on urls model.
add this code in urls.py
0👍
If you are using rest_framework in django then import:
from rest_framework import views
- How to populate user profile with django-allauth provider information?
- "x Days ago' template filter in Django?
- Is there any way to use GUIDs in django?
Source:stackexchange.com