简体   繁体   English

DJANGO CRUD 没有名为“django.contrib.name”的模块

[英]DJANGO CRUD No module named 'django.contrib.name'

when I've open cmd and command this python manage.py makemigrations Then I've got this huge problem.当我打开 cmd 并命令这个python manage.py makemigrations然后我遇到了这个大问题。 I can't understad what to do.我不明白该怎么做。

Traceback (most recent call last):
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\config.py", line 118, in create
    cls = getattr(mod, cls_name)
AttributeError: module 'django.contrib' has no attribute 'name'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\core\management\__init__.py", line 347, in execute
    django.setup()
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\site-packages\django\apps\config.py", line 123, in create
    import_module(entry)
  File "C:\Users\s\AppData\Local\Programs\Python\Python37-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'django.contrib.name'

WHat should I change from setting.py file?:我应该从 setting.py 文件中更改什么?:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.name',
'django.contrib.email',
'django.contrib.address',
'django.contrib.phone',

] ]

The problem is that there is no module named问题是没有命名的模块

django.contrib.name

And that's what Django is actually telling you.这就是 Django 实际上告诉你的。 INSTALLED_APPS variable is for Django modules that you're using in project and apps created by you. INSTALLED_APPS 变量适用于您在项目和您创建的应用程序中使用的 Django 模块。 Delete those:删除那些:

'django.contrib.name',
'django.contrib.email',
'django.contrib.address',
'django.contrib.phone',

run migration and it should work.运行迁移,它应该可以工作。 Tell me what you meant to do with those name, email, address and phone variables and I will try to help you get it going.告诉我你想用这些名字 email、地址和电话变量做什么,我会尽力帮助你。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ModuleNotFoundError:没有名为“django.contrib.staticfilesbase”的模块 - ModuleNotFoundError: No module named 'django.contrib.staticfilesbase' 没有名为“django.contrib.staticfiles.templatetags”的模块 - No module named 'django.contrib.staticfiles.templatetags' 没有名为 django.contrib.auth.hashers 的模块 - No module named django.contrib.auth.hashers 带有Django的Pyinstaller:ModuleNotFoundError:没有名为“ django.contrib.admin.apps”的模块 - Pyinstaller with Django: ModuleNotFoundError: No module named 'django.contrib.admin.apps' 如何解决 No module named 'django.contrib.staticfilespages' in Django? - How to solve No module named 'django.contrib.staticfilespages' in Django? 带有Django的Pyinstaller:ModuleNotFoundError:没有名为django.contrib.messages.apps的模块 - Pyinstaller with Django: ModuleNotFoundError: No Module Named django.contrib.messages.apps DJANGO:没有名为 social_auth.backends.contrib.github 的模块 - DJANGO: No module named social_auth.backends.contrib.github “没有命名模块 <module name> django上的错误 - “No module named <module name>” Error on django Django项目的Pyinstaller错误“导入错误:没有名为&#39;django.contrib.admin.apps&#39;的模块” - Pyinstaller Error for Django project “ImportError: No module named 'django.contrib.admin.apps'” Django ViewSet ModuleNotFoundError:没有名为“项目名称”的模块 - Django ViewSet ModuleNotFoundError: No module named 'project name'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM