From the look of things, it seems:
-You're following the Django v2.0 tutorial.
-You have installed a Django v1 version.
This is an example with Django v2:
>>> import django
>>> django.get_version()
'2.0.5'
>>> from django.urls import include, path
>>>
[No error]
>>> django.get_version()
'2.0.5'
>>> from django.urls import include, path
>>>
[No error]
And this is an example with Django v1.11
>>> from django import get_version
>>> get_version()
'1.11.13'
>>> from django.urls import include, urls
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: cannot import name 'include'
>>>
>>> get_version()
'1.11.13'
>>> from django.urls import include, urls
Traceback (most recent call last):
File "<console>", line 1, in <module>
ImportError: cannot import name 'include'
>>>
So either you upgrade your Django package, or you follow your Django version's tutorial :)
El vie., 4 may. 2018 a las 15:12, <gkfka5968@ajou.ac.kr> escribió:
I run 'python manage.py runserver'.--but this message appear.Traceback (most recent call last):File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\autoreload.py", line 228, in wrapperfn(*args, **kwargs)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\commands\runserver.py", line 124, in inner_runself.check(display_num_errors=True)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\base.py", line 359, in checkinclude_deployment_checks=include_deployment_checks,File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\management\base.py", line 346, in _run_checksreturn checks.run_checks(**kwargs)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\registry.py", line 81, in run_checksnew_errors = check(app_configs=app_configs)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\urls.py", line 16, in check_url_configreturn check_resolver(resolver)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\core\checks\urls.py", line 26, in check_resolverreturn check_method()File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py", line 254, in checkfor pattern in self.url_patterns:File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py", line 405, in url_patternspatterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\utils\functional.py", line 35, in __get__res = instance.__dict__[self.name] = self.func(instance)File "C:\Users\gkfka\PycharmProjects\django\venv\lib\site-packages\django\urls\resolvers.py", line 398, in urlconf_modulereturn import_module(self.urlconf_name)File "c:\Python27\Lib\importlib\__init__.py", line 37, in import_module__import__(name)File "C:\Users\gkfka\PycharmProjects\django\cafe\mysite\mysite\urls.py", line 17, in <module>from django.urls import include, pathImportError: cannot import name include
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/e9634a2e-8970-4f14-bb2b-1275ce305fad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Fidel Leon
Phone: +34 622 26 44 92
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/CAHXg%3DN1JFHZBryqHtMM0DbBf5Q9XyG6h%2BAJmFAmH7UbWU8jPjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment