搞定xadmin配置的前三个步骤后,第四个步骤,运行manage.py出bug

来源:9-2 通过django内置的login完成登录

曾嘱咐

2022-04-18

图片描述
图片描述
图片描述
无法提取 “MxOnline” 模块中的实际命令: Python 进程死亡,代码为 1: Traceback (most recent call last):
File “C:\Users\86187\AppData\Roaming\Python\Python39\site-packages\django\apps\config.py”, line 118, in create
cls = getattr(mod, cls_name)
AttributeError: module ‘apps.users.apps’ has no attribute ‘UsersConfigcrispy_forms’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “D:\pycharm\PyCharm 2021.2.3\plugins\python\helpers\pycharm_jb_manage_tasks_provider.py”, line 25, in
django.setup()
File “C:\Users\86187\AppData\Roaming\Python\Python39\site-packages\django_init_.py”, line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File “C:\Users\86187\AppData\Roaming\Python\Python39\site-packages\django\apps\registry.py”, line 91, in populate
app_config = AppConfig.create(entry)
File “C:\Users\86187\AppData\Roaming\Python\Python39\site-packages\django\apps\config.py”, line 132, in create
raise ImproperlyConfigured(
django.core.exceptions.ImproperlyConfigured: ‘apps.users.apps’ does not contain a class ‘UsersConfigcrispy_forms’. Choices are: ‘UsersConfig’.

写回答

3回答

曾嘱咐

提问者

2022-04-19

我又重新用django的2.2.28和python3.7做了一遍,本来以为没bug了,后来发现settings里面少安装了4个APP,加上之后又报错了.但是注释掉却没有bug//img.mukewang.com/szimg/625ddf85083d2fb916000890.jpg

0
1
曾嘱咐
# 'apps.users.apps.UsersConfig', # 'apps.courses.apps.CoursesConfig', # 'apps.organizations.apps.OrganizationsConfig', # 'apps.operations.apps.OperationsConfig'
2022-04-19
共1条回复

曾嘱咐

提问者

2022-04-18

也许切换版本后,不需要重新用命令新建项目,只需要修改settings.py和url.py.

版本兼容的问题令我好头疼,现在django2.2好像也要不支持了,以后或许要用3.2了

0
0

曾嘱咐

提问者

2022-04-18

在pycharm中将解释器中django切换到2.2.8版本,重新新建项目后,无报错了.


之前pycharm新建的是django的4.0.4版本

0
1
bobby
好的,那现在能运行了吧
2022-04-21
共1条回复

Django+ xadmin 开发在线教育网站

一套通用的技术组合拳,助你解决大部分Python类网站后端问题

1911 学习 · 2149 问题

查看课程