输入python manage.py runserver 127.0.0.1:8000报错
来源:3-1 开发接口环境搭建

慕移动2453666
2018-09-07
C:\Users\cs.000.000\PycharmProjects\untitled>python manage.py runserver 127.0.0.1:8000Performing system checks...Unhandled exception in thread started by .wrapper at 0x00000215F4570EA0>Traceback (most recent call last): File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\utils\autoreload.py", line 226, in wrapper fn(*args, **kwargs) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\management\commands\runserver.py", line 121, in inner_run self.check(display_num_errors=True) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\management\base.py", line 374, in check include_deployment_checks=include_deployment_checks, File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\management\base.py", line 361, in _run_checks return checks.run_checks(**kwargs) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\checks\registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\checks\urls.py", line 14, in check_url_config return check_resolver(resolver) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\core\checks\urls.py", line 24, in check_resolver for pattern in resolver.url_patterns: File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\utils\functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\urls\resolvers.py", line 313, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\utils\functional.py", line 35, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "C:\Python35\lib\site-packages\django-1.10.8-py3.5.egg\django\urls\resolvers.py", line 306, in urlconf_module return import_module(self.urlconf_name) File "C:\Python35\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 986, in _gcd_import File "", line 969, in _find_and_load File "", line 958, in _find_and_load_unlocked File "", line 673, in _load_unlocked File "", line 662, in exec_module File "", line 222, in _call_with_frames_removed File "C:\Users\cs.000.000\PycharmProjects\untitled\untitled\urls.py", line 17, in from django.urls import pathImportError: cannot import name 'path'
写回答
1回答
-
Mushishi
2018-09-07
你好这个错误你截图+你代码,这个类似错误建议你百度一下。
这个章节的错误也有类似的问题:
from django.contrib import admin
from django.urls import path
import blog.views as bv
urlpatterns = [
path('admin/', admin.site.urls),
path('index/', bv.index),
]
00
相似问题