首页上一页 1 下一页尾页 1 条记录 1/1页
在PyCharm 2021中执行python manage.py makemigrations,会出现报错
发表在Python图书答疑
2023-01-16
《零基础学Python》第16章 常用Web框架
是否精华
是
否
版块置顶:
是
否
在PyCharm 2021中
通过命令符 net start mysql80 能正常打开服务端
然后通过mysql -u root -p
也能正常进入mysql的操作界面
也能在内部建立数据表
但执行下面命令
python manage.py makemigrations
然后弹出提示报错如下
Traceback (most recent call last): File "G:\xiazai\manage.py", line 22, in <module> main() File "G:\xiazai\manage.py", line 18, in main execute_from_command_line(sys.argv) File "C:\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 446, in execute_from_command_line utility.execute() File "C:\Python\Python310\lib\site-packages\django\core\management\__init__.py", line 420, in execute File "C:\Python\Python310\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate django.setup() File "C:\Python\Python310\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Python\Python310\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "C:\Python\Python310\lib\site-packages\django\apps\config.py", line 193, in create import_module(entry) File "C:\Python\Python310\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1050, in _gcd_import File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked ModuleNotFoundError: No module named 'article apps ArticleConfig'
在settings.py文件中建立数据库信息也是正常
# Database # https://docs.djangoproject.com/en/4.1/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mysql80', 'USER': 'root', 'PASSWORD': '123456', 'HOST': 'localhost', 'PORT': '3306', } }
已经折腾了好几天时间了,不知道怎么解决上面的报错
请求解惑
第一次在社区发布,没有学分悬赏,还请各位老师不吝指教