- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我对 Django 注册有疑问。该软件包已正确安装,但是当我运行 python3.6 manage.py runserver
时,我收到以下错误:
ModuleNotFoundError:没有名为“注册”的模块
我的 Settings.py、Urls.py 和 HTML 模板文件的屏幕截图附在下面:
[在此处输入图片描述][1]
正在执行系统检查...
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10df3cb70>
Traceback (most recent call last):
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 227, in wrapper
fn(*args, **kwargs)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
self.check(display_num_errors=True)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/Users/melissamalala/PycharmProjects/moringatribune/tribune/urls.py", line 25, in <module>
url(r'^accounts/', include('registration.backends.simple.urls')),
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/conf/urls/__init__.py", line 50, in include
urlconf_module = import_module(urlconf_module)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 936, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'registration'
^CTraceback (most recent call last):
File "manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 13, in <module>
(venv) Melissas-MacBook-Pro:moringatribune melissamalala$ python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10d9da8c8>
Traceback (most recent call last):
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 227, in wrapper
fn(*args, **kwargs)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
autoreload.raise_last_exception()
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
six.reraise(*_exception)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 227, in wrapper
fn(*args, **kwargs)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Users/melissamalala/PycharmProjects/moringatribune/venv/lib/python3.6/site-packages/django/apps/config.py", line 94, in create
module = import_module(entry)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'registration'
[1]: /image/pkJQZ.jpg
最佳答案
来自 docs :
Prior to 3.x, django-registration installed a Python module named registration. To avoid silent incompatibilities, and to conform to more recent best practices, django-registration 3.x now installs a module named django_registration. Attempts to import from the registration module will immediately fail with ImportError.
关于django - ModuleNotFoundError : No module named 'registration' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52493688/
I have installed WeasyPrint==0.42.3 using pip3 install WeasyPrint==0.42.3, but when I try to impo
我正在从远程服务器设置Jupyter笔记本电脑环境。当我导入Notebook.auth时,它报告错误如下:。我的jupyter参数如下所示:。有人知道如何解决这个问题吗?我已经尝试了pip安装jupy
在运行命令时,我遇到了一个错误:Heroku run pythonManage.py Migrate。当我运行它时,它会出现错误:ModuleNotFoundError:没有名为‘Django’的模块
PC:Windows 11 WSL 2,ubuntu-22.04。我打算按照这些说明安装'cnntools'。安装后,我对其进行了测试。这件事就发生了。。我的电脑怎么了?我必须买一台新电脑吗?。我试过
我的文件夹结构是: |-fastapi |-app |-calc.py |-tests |-mytest.py 在 mytest.py 中,我尝试导入 calc.py,
假设我们有以下结构: outer_module.py| |subfolder| |__init__.py
我在 conda 中创建了一个新环境并安装了 yaml。 $ conda list | grep yaml yaml 0.1.7
我使用了来自 python-nmap 的 import nmap 模块,它在 Pycharm 中运行良好。 但是当我尝试在命令提示符下运行相同的程序时,出现错误: ModuleNotFoundErro
my_controller.py 如下: from models import Person david = Person('David') 我的项目结构是 app ├── controller │
我已经使用 tensorflow 构建了一个 python 脚本,现在我正在尝试将其转换为 .exe 文件,但遇到了问题。使用 pyinstaller 并从命令提示符运行程序后,我收到以下错误: Fi
我在网络驱动器上安装了 Python。我用了pushd命令进入同一网络驱动器上我的项目文件夹。我在那个文件夹中打开 python。我尝试导入该文件夹中的模块。一个 ModuleNotFoundErro
我的发行版是WinPython,我使用Spyder作为IDLE,我的python版本是3.6.5。 尽管我有很多模块(来自 WinPython 下载),例如 pip、pandas 和 numpy,它们
我在 macOS Mojave 版本 10.14.1 上使用 Python 3.7.1 这是我的目录结构: man/ Mans/
我的文件夹结构: ttsTacotron.py Tacotron-2 |.. |tacotron| |train.py |synthetizer.py
我正在使用 Python 3.6.0 和 pipenv。我在pycharm中有一个名为myapp的python项目,目录结构为 - myapp - src - __init__.py -
我利用自制程序安装 python3,现在无法运行使用关联的 pip3 二进制文件安装的模块。 from blackduck.HubRestApi import HubInstance username
我正在开发 Flask 应用程序并尝试运行我的测试文件,但无法执行此操作。我当前的应用程序结构是: Project ── app │ ├── __init__.py │ ├── forms.p
(在用重复的问题投票标记我之前,请注意,我在这个问题上找到的所有内容都与 virtualenv 有关,而不是 venv) 系统: Ubuntu 服务器 16.04 已安装 Python 3.6,原生
Visual Studio 2017 - 空 Python 项目我的代码如下所示(是的,只有两行): import pandas as pd import Quandl 我已将 Quandl (3.2
我需要 pickle 我已经实例化的 python 类,因此需要使用相对路径。我正在使用 Python 版本 3.6.6。以下是项目结构和代码的示例: modelling/ test.py
我是一名优秀的程序员,十分优秀!