Django path('challenges/',include(challenges.urls)) NameError: name 'challenges' is not defined

56 views Asked by At

When I comment

urlpatterns = [
   path('admin/', admin.site.urls),
   #path('challenges/',include(challenges.urls))
]

it is working fine but for

urlpatterns = [
   path('admin/', admin.site.urls),
   path('challenges/',include(challenges.urls))
]

it is throwing an error

enter image description here

why the error is occurring when I am using

urlpatterns = [
   path('admin/', admin.site.urls),
   path('challenges/',include(challenges.urls))
]
1

There are 1 answers

3
Darsh Modi On BEST ANSWER

you have to write like this in quotes,

path('challenges/',include("challenges.urls"))