没有来自django.conf.urls的名为“ django.urls”的模块导入URL

时间:2019-03-21 19:10:47

标签: python-3.6 django-1.8

当python manage.py runserver出现问题。我该如何解决。 我正在使用python3.6.8和django-1.8.9。我正在尝试推荐系统。你能帮我吗?

环境:

Request Method: GET
Request URL: http://127.0.0.1:8000/

settings.py

 Django Version: 1.8.9
    Python Version: 3.6.8
    Installed Applications:
    ('django.contrib.admin',
     'django.contrib.auth',
     'django.contrib.contenttypes',
     'django.contrib.sessions',
     'django.contrib.messages',
     'django.contrib.staticfiles',
     'bootstrap3',
     'reviews',
     'registration')
    Installed Middleware:
    ('django.contrib.sessions.middleware.SessionMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
     'django.contrib.messages.middleware.MessageMiddleware',
     'django.middleware.clickjacking.XFrameOptionsMiddleware',
     'django.middleware.security.SecurityMiddleware')

当ı运行python manage.py runserver

Traceback:
File "D:\Django_Project\winerama\venv\lib\site-packages\django\core\handlers\base.py" in get_response
  119.                 resolver_match = resolver.resolve(request.path_info)
File "D:\Django_Project\winerama\venv\lib\site-packages\django\core\urlresolvers.py" in resolve
  365.             for pattern in self.url_patterns:
File "D:\Django_Project\winerama\venv\lib\site-packages\django\core\urlresolvers.py" in url_patterns
  401.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "D:\Django_Project\winerama\venv\lib\site-packages\django\core\urlresolvers.py" in urlconf_module
  395.             self._urlconf_module = import_module(self.urlconf_name)
File "C:\python3.6\lib\importlib\__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)
File "D:\Django_Project\winerama\winerama\urls.py" in <module>
  22.     url(r'^accounts/', include('registration.backends.simple.urls')),
File "D:\Django_Project\winerama\venv\lib\site-packages\django\conf\urls\__init__.py" in include
  33.         urlconf_module = import_module(urlconf_module)
File "C:\python3.6\lib\importlib\__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)
File "C:\python3.6\lib\site-packages\registration\backends\simple\urls.py" in <module>
  44.         url(r'', include('registration.auth_urls')),
File "D:\Django_Project\winerama\venv\lib\site-packages\django\conf\urls\__init__.py" in include
  33.         urlconf_module = import_module(urlconf_module)
File "C:\python3.6\lib\importlib\__init__.py" in import_module
  126.     return _bootstrap._gcd_import(name[level:], package, level)
File "C:\python3.6\lib\site-packages\registration\auth_urls.py" in <module>
  27. from django.urls import reverse_lazy

Exception Type: ModuleNotFoundError at /
Exception Value: No module named 'django.urls'

0 个答案:

没有答案