Answer the question
In order to leave comments, you need to log in
Django module not defined?
Hello! In the urls of the project, I add the inclusion string for the app urls module .
urlpatterns = [
url('admin/', admin.site.urls),
url('',app.urls, name = 'app')
]
url('',app.urls, name = 'app')
NameError: name 'app' is not defined
Answer the question
In order to leave comments, you need to log in
I assume you set the application urls in the main urls.py
In this case, it should be done like this
from django.urls import include
# ...
urlpatterns = [
# ...
path('', include('app.urls', namespace='app')),
]
# ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question