运行:
makemigrations
报错:
manage.py@yc_xadmin_v1 > makemigrations
"C:\Program Files\JetBrains\PyCharm 2017.1.3\bin\runnerw.exe" C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\python.exe "C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pycharm\django_manage.py" makemigrations C:/Users/huanglianggu/PycharmProjects/yancheng--yc-xadmin-v1/yc_xadmin_v1
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2017.1.3\helpers\pycharm\django_manage.py", line 43, in <module>
run_module(manage_file, None, '__main__', True)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:/Users/huanglianggu/PycharmProjects/yancheng--yc-xadmin-v1/yc_xadmin_v1\manage.py", line 21, in <module>
main()
File "C:/Users/huanglianggu/PycharmProjects/yancheng--yc-xadmin-v1/yc_xadmin_v1\manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\base.py", line 83, in wrapped
res = handle_func(*args, **kwargs)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\management\commands\makemigrations.py", line 141, in handle
loader.project_state(),
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\loader.py", line 324, in project_state
return self.graph.make_state(nodes=nodes, at_end=at_end, real_apps=list(self.unmigrated_apps))
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\graph.py", line 315, in make_state
project_state = self.nodes[node].mutate_state(project_state, preserve=False)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\migration.py", line 87, in mutate_state
operation.state_forwards(self.app_label, new_state)
File "C:\Users\huanglianggu\AppData\Local\Programs\Python\Python38\lib\site-packages\django\db\migrations\operations\fields.py", line 229, in state_forwards
state.models[app_label, self.model_name_lower].fields
KeyError: ('xadmin', 'logs')
Process finished with exit code 1
解决办法:
文章评论