LookupError: No installed app with label 'user'.报错
来源:3-5 django url templates配置
慕无忌3194290
2022-04-13
Error fetching command ‘collectstatic’: You’re using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.
Command ‘collectstatic’ skipped
Error fetching command ‘createsuperuser’: AUTH_USER_MODEL refers to model ‘user.UserProfile’ that has not been installed
Command ‘createsuperuser’ skipped
manage.py@MxOnline > makemigrations users
C:\Users\Administrator\Envs\mxonline\Scripts\python.exe “C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pycharm\django_manage.py” makemigrations users C:/Users/Administrator/PycharmProjects/MxOnline
('Tracking file by folder pattern: ', ‘migrations’)
Traceback (most recent call last):
File “C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pycharm\django_manage.py”, line 52, in
run_command()
File “C:\Program Files\JetBrains\PyCharm 2021.3.3\plugins\python\helpers\pycharm\django_manage.py”, line 46, in run_command
run_module(manage_file, None, ‘main’, True)
File “c:\python27\lib\runpy.py”, line 188, in run_module
fname, loader, pkg_name)
File “c:\python27\lib\runpy.py”, line 82, in run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
File “c:\python27\lib\runpy.py”, line 72, in run_code
exec code in run_globals
File “C:\Users\Administrator\PycharmProjects\MxOnline\manage.py”, line 10, in
execute_from_command_line(sys.argv)
File "C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\management_init.py", line 353, in execute_from_command_line
utility.execute()
File "C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\management_init.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\management\base.py”, line 348, in run_from_argv
self.execute(*args, **cmd_options)
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\management\base.py”, line 398, in execute
self.check()
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\management\base.py”, line 426, in check
include_deployment_checks=include_deployment_checks,
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\core\checks\registry.py”, line 75, in run_checks
new_errors = check(app_configs=app_configs)
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\contrib\auth\checks.py”, line 12, in check_user_model
cls = apps.get_model(settings.AUTH_USER_MODEL)
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\apps\registry.py”, line 197, in get_model
return self.get_app_config(app_label).get_model(model_name.lower())
File “C:\Users\Administrator\Envs\mxonline\lib\site-packages\django\apps\registry.py”, line 155, in get_app_config
raise LookupError(message)
LookupError: No installed app with label ‘user’.
Process finished with exit code 1
报错,也是加了 ‘users’
]
AUTH_USER_MODEL = "user.UserProfile"字段,然后还是不好用
1回答
-
bobby
2022-04-17
你的user下的apps.py的源码截图我看看
00
相似问题