欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Django的部分bug

程序员文章站 2022-04-26 12:10:12
...
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\core\management\__init__.py", line 377, in execute
    django.setup()
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\apps\registry.py", line 95, in populate
    "duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't unique, duplicates: MyApp

在setting文件里面重复添加了app的那么,因为在项目创建的时候就默认添加了名字,没必要再添加了

Django的部分bug

出现这个bug

File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\models\base.py", line 325, in add_to_class
    value.contribute_to_class(cls, name)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\models\options.py", line 208, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\__init__.py", line 28, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\utils.py", line 207, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\utils.py", line 111, in load_backend
    return import_module('%s.base' % backend_name)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "F:\PythonWorkPlace\HelloDjango\venv\lib\site-packages\django\db\backends\mysql\base.py", line 37, in <module>
    raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

Django的部分bug

运行:

python manage.py makemigrations
python manage.py migrate

 

Django的部分bug

成功!!!!!!!!!

相关标签: 【Django】