Error Python NameError name include is not defined

0 votes

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 (Stacktrace points to a line in urls.py):

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

Where can I import include from?

Jul 1, 2020 in Python by kartik
• 37,520 points
9,997 views

1 answer to this question.

0 votes

Hello @kartik,

On the basis of your information provided in the question, i think you might have forget to add the following import in your urls.py file.

from django.conf.urls import include

Hope this works!!

Thank You!!

answered Jul 1, 2020 by Niroj
• 82,840 points
0 votes
from django.urls import include

you can import it from there in the setting urls
answered Feb 17, 2022 by anonymous

edited Mar 5

Related Questions In Python

0 votes
1 answer

Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 69,220 points
14,113 views
0 votes
3 answers

Python error "NameError: name 'sr' is not defined"

write at start of code import speech_recognition as ...READ MORE

answered Mar 17, 2021 in Python by Honir

edited Mar 5 43,170 views
0 votes
1 answer

Python error "Python NameError: global name 'Thread' is not defined"

There is a built-in function with the ...READ MORE

answered May 31, 2019 in Python by Riya
7,607 views
–1 vote
1 answer

Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

answered Nov 29, 2019 in Python by Casper
• 160 points
7,122 views
0 votes
1 answer

How to temporarily disable a foreign key constraint in MySQL?

Hello @kartik, To turn off foreign key constraint ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
2,719 views
0 votes
1 answer

How do I use Django templates without the rest of Django?

Hello @kartik, Let's say you have this important ...READ MORE

answered Jun 23, 2020 in Python by Niroj
• 82,840 points
1,692 views
0 votes
1 answer

Input() error - NameError: name '…' is not defined

Hello @kartik, You should use raw_input if you are ...READ MORE

answered May 5, 2020 in Python by Niroj
• 82,840 points
23,761 views
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, It seems mysql_config is missing on ...READ MORE

answered May 5, 2020 in Python by Niroj
• 82,840 points
3,193 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP