老师,昨天项目运行挺好的,今天创建新表时,提示如下错,解决很久,但未能解决,特地请教老师,谢谢!
项目所使用的:
Python 3.6.8
Django 2.2
manage.py@BusinessActivity > makemigrations user_operation
ssh://root@192.168.6.21:22/root/.virtualenvs/BA_env/bin/python -u /root/.pycharm_helpers/pycharm/django_manage.py makemigrations user_operation /root/wsh/my_projects/BusinessActivity
Tracking file by folder pattern: migrations
utf-8
Traceback (most recent call last):
File “/root/.pycharm_helpers/pycharm/django_manage.py”, line 52, in
run_command()
File “/root/.pycharm_helpers/pycharm/django_manage.py”, line 46, in run_command
run_module(manage_file, None, ‘main’, True)
File “/usr/local/lib/python3.6/runpy.py”, line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File “/usr/local/lib/python3.6/runpy.py”, line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File “/usr/local/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/root/wsh/my_projects/BusinessActivity/manage.py”, line 20, in
main()
File “/root/wsh/my_projects/BusinessActivity/manage.py”, line 16, in main
execute_from_command_line(sys.argv)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/init.py”, line 381, in execute_from_command_line
utility.execute()
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/init.py”, line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/base.py”, line 323, in run_from_argv
self.execute(*args, **cmd_options)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/base.py”, line 364, in execute
output = self.handle(*args, **options)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/base.py”, line 83, in wrapped
res = handle_func(*args, **kwargs)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py”, line 141, in handle
loader.project_state(),
File “/root/.virtualenvs/BA_env/lib/python3.6/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 “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/db/migrations/graph.py”, line 315, in make_state
project_state = self.nodes[node].mutate_state(project_state, preserve=False)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/db/migrations/migration.py”, line 87, in mutate_state
operation.state_forwards(self.app_label, new_state)
File “/root/.virtualenvs/BA_env/lib/python3.6/site-packages/django/db/migrations/operations/fields.py”, line 172, in state_forwards
delay = not old_field.is_relation
AttributeError: ‘NoneType’ object has no attribute ‘is_relation’
Process finished with exit code 1
Django REST framework课程视频,RESTFul API前后端分离开发
了解课程