File "manage.py", line 16, in
execute_from_command_line(sys.argv)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 200, in handle
fake_initial=fake_initial,
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/migrations/executor.py", line 250, in apply_migration
self.recorder.record_applied(migration.app_label, migration.name)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 71, in record_applied
self.migration_qs.create(app=app, name=name)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/query.py", line 417, in create
obj.save(force_insert=True, using=self.db)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/base.py", line 729, in save
force_update=force_update, update_fields=update_fields)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/base.py", line 759, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/base.py", line 842, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/base.py", line 880, in _do_insert
using=using, raw=raw)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/query.py", line 1125, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1287, in execute_sql
return self.connection.ops.fetch_returned_insert_id(cursor)
File "/home/jiso/.virtualenvs/TDMS_Env/lib/python3.6/site-packages/django/db/backends/oracle/operations.py", line 228, in fetch_returned_insert_id
return int(cursor._insert_id_var.getvalue())
这是我在为数据库增加新的字段运行migrate指令时遇见的一个错误,导致这个错误的原因是因为你使用的cx_Oracle这个驱动插件的版本过高,可以参考我的,我使用的Django是2.0的Python3.6.5,对应cx_Oracle应该是6.X系列,如果是7.X系列,你还是赶快卸载吧,重新装6.X系列的