Hi Jamie,
I think you should put single quotes inside include() which expects a path
for your apps(polls) urls.py. So try-
path('polls/',include('polls.urls'))
Hope this helps.
On Tue, 5 Jun 2018, 2:59 a.m. Jaime Escobar, <[email protected]> wrote:
> Hi,
> I am a completely beginner in django and also python programming. I am
> trying to follow the online documentation tutorial in which a poll website
> is created, but just running the server after created the polls it throws
> the error "name 'polls' is not defined".
>
> Can you help me?
>
>
> Unhandled exception in thread started by <function
> check_errors.<locals>.wrapper at 0x7feeeb74ab70>
> Traceback (most recent call last):
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/autoreload.py",
> line 225, in wrapper
> fn(*args, **kwargs)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/commands/runserver.py",
> line 120, in inner_run
> self.check(display_num_errors=True)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
> line 364, in check
> include_deployment_checks=include_deployment_checks,
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/management/base.py",
> line 351, in _run_checks
> return checks.run_checks(**kwargs)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/registry.py",
> line 73, in run_checks
> new_errors = check(app_configs=app_configs)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py",
> line 40, in check_url_namespaces_unique
> all_namespaces = _load_all_namespaces(resolver)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/core/checks/urls.py",
> line 57, in _load_all_namespaces
> url_patterns = getattr(resolver, 'url_patterns', [])
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py",
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py",
> line 540, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns",
> self.urlconf_module)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/utils/functional.py",
> line 36, in __get__
> res = instance.__dict__[self.name] = self.func(instance)
> File
> "/home/jaime/.local/lib/python3.6/site-packages/django/urls/resolvers.py",
> line 533, in urlconf_module
> return import_module(self.urlconf_name)
> File "/usr/lib/python3.6/importlib/__init__.py", line 126, in
> import_module
> return _bootstrap._gcd_import(name[level:], package, level)
> File "<frozen importlib._bootstrap>", line 994, in _gcd_import
> File "<frozen importlib._bootstrap>", line 971, in _find_and_load
> File "<frozen importlib._bootstrap>", line 955, in
> _find_and_load_unlocked
> File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
> File "<frozen importlib._bootstrap_external>", line 678, in exec_module
> File "<frozen importlib._bootstrap>", line 219, in
> _call_with_frames_removed
> File "/home/jaime/Projects/Django/mysite/mysite/urls.py", line 20, in
> <module>
> path('polls/',include(polls.urls)),
> NameError: name 'polls' is not defined
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" 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].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/df3c68c4-aa2a-498d-a1ed-840a31acf7a2%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/df3c68c4-aa2a-498d-a1ed-840a31acf7a2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" 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].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAPBHpYD2bvojRHMpJKpyG7PMcvNDzyOr%3Dd3dFtQ729K_NnPUiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.