NameError: name 'playground' is not defined

Viewed 28

I am beginner. I am trying to learn Django. But I face a problem. I defined app name inside my project file but django did not found it. I am using Atom as a Code Edittor. Please Any one help me..enter image description here this is my code path('playground/',include(playground.urls))

File "C:\Users\Hasan\Documents\Django\STOREPRONT\STOREPRONT\urls.py", line 8, in path('playground/',include(playground.urls)) NameError: name 'playground' is not defined

3 Answers

You have to import playground.urls:

import playground.urls

Do :

include("playground.urls")

Instead of :

include(playground.urls)

Wrap the string in quotes:

path('playground/', include('playground.urls')
Related