Python NameError: name 'include' is not defined

PythonDjangoNameerror

Python Problem Overview


I'm currently developing a website with the framework Django (I'm very beginner), but I have a problem with Python: since I have created my templates, I can't run server anymore for this reason (the stack trace points to a line in file urls.py):

<stacktrace>
...
path('apppath/', include('myapp.urls')),
NameError: name 'include' is not defined

Where can I import include from?

Python Solutions


Solution 1 - Python

Guessing on the basis of whatever little information provided in the question, I think you might have forgotten to add the following import in your urls.py file.

from django.conf.urls import include

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioneloiletagantView Question on Stackoverflow
Solution 1 - PythonRahul GuptaView Answer on Stackoverflow