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的那么,因为在项目创建的时候就默认添加了名字,没必要再添加了
出现这个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.
运行:
python manage.py makemigrations
python manage.py migrate
成功!!!!!!!!!
上一篇: 解Bug之路-Druid的Bug
下一篇: 内存管理
推荐阅读
-
Mysql单文件存储删除数据文件容量不会减少的bug与解决方法
-
SQL Server Bulk Insert 只需要部分字段时的方法
-
大家来找茬 Spartan浏览器的BUG最高悬赏$15000
-
关于pycharm中缩进、粘贴复制等文本编辑功能部分失效的解决办法
-
利用django+wechat-python-sdk 创建微信服务器接入的方法
-
mysql 卡死 大部分线程长时间处于sending data的状态
-
Python的Django框架可适配的各种数据库介绍
-
Django查找网站项目根目录和对正则表达式的支持
-
django ajax json的实例代码
-
在Django的模型和公用函数中使用惰性翻译对象