#27553: tutorial python manage.py runserver creates NameError: name 'include' is
not defined
-------------------------------------+-------------------------------------
Reporter: Roel Hogervorst | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: invalid
Keywords: windows10, getting | Triage Stage:
started, exception | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):
* status: new => closed
* resolution: => invalid
Old description:
> Hi there, I tried the tutorial / introduction to django and get stuck. I
> have installed django, verified that it is working :
> ```
> python 3.5.2:4def2a2901a5 on win32, and django 1.10.3 on mingw32 on a
> windows 10 machine.
> ```
>
> I did not install a virtual environment.
>
> `django-admin startproject mysite` worked
>
> I cd into the mysite directory (the top one, that is, the one below , `cd
> mysite` )
>
> The next step does not work though:
> python manage.py runserver gives me this output
> ```
> Performing system checks...
>
> Unhandled exception in thread started by <function
> check_errors.<locals>.wrapper at 0x03FB28A0>
> Traceback (most recent call last):
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\utils\autoreload.py", line 226, in wrapper
> fn(*args, **kwargs)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\management\commands\runserver.py", line 121, in
> inner_run
> self.check(display_num_errors=True)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\management\base.py", line 374, in check
> include_deployment_checks=include_deployment_checks,
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\management\base.py", line 361, in _run_checks
> return checks.run_checks(**kwargs)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\checks\registry.py", line 81, in run_checks
> new_errors = check(app_configs=app_configs)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\checks\urls.py", line 14, in check_url_config
> return check_resolver(resolver)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\core\checks\urls.py", line 24, in check_resolver
> for pattern in resolver.url_patterns:
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\utils\functional.py", line 35, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\urls\resolvers.py", line 313, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\utils\functional.py", line 35, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
> File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
> packages\django\urls\resolvers.py", line 306, in urlconf_module
> return import_module(self.urlconf_name)
> File
> "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
> line 126, in import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 986, in _gcd_import
> File "<frozen importlib._bootstrap>", line 969, in _find_and_load
> File "<frozen importlib._bootstrap>", line 958, in
> _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
> File "<frozen importlib._bootstrap_external>", line 665, in exec_module
> File "<frozen importlib._bootstrap>", line 222, in
> _call_with_frames_removed
> File
> "D:\RmhDocs\Documents\docs\actief\Projecten\django\mysite\mysite\urls.py",
> line 20, in <module>
> url(r'^polls/', include('polls.urls')),
> NameError: name 'include' is not defined
New description:
Hi there, I tried the tutorial / introduction to django and get stuck. I
have installed django, verified that it is working :
{{{
python 3.5.2:4def2a2901a5 on win32, and django 1.10.3 on mingw32 on a
windows 10 machine.
}}}
I did not install a virtual environment.
`django-admin startproject mysite` worked
I cd into the mysite directory (the top one, that is, the one below , `cd
mysite` )
The next step does not work though:
python manage.py runserver gives me this output
{{{
Performing system checks...
Unhandled exception in thread started by <function
check_errors.<locals>.wrapper at 0x03FB28A0>
Traceback (most recent call last):
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\utils\autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\management\commands\runserver.py", line 121, in
inner_run
self.check(display_num_errors=True)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\management\base.py", line 374, in check
include_deployment_checks=include_deployment_checks,
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\management\base.py", line 361, in _run_checks
return checks.run_checks(**kwargs)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\checks\registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\checks\urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\core\checks\urls.py", line 24, in check_resolver
for pattern in resolver.url_patterns:
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\urls\resolvers.py", line 313, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns",
self.urlconf_module)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\utils\functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\site-
packages\django\urls\resolvers.py", line 306, in urlconf_module
return import_module(self.urlconf_name)
File
"C:\Users\roel\AppData\Local\Programs\Python\Python35-32\lib\importlib\__init__.py",
line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in
_call_with_frames_removed
File
"D:\RmhDocs\Documents\docs\actief\Projecten\django\mysite\mysite\urls.py",
line 20, in <module>
url(r'^polls/', include('polls.urls')),
NameError: name 'include' is not defined
}}}
--
Comment:
Please see TicketClosingReasons/UseSupportChannels for ways to get help.
--
Ticket URL: <https://code.djangoproject.com/ticket/27553#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.0df7abe97575a3a8a49a143468d1b23f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.