Python2.7(centOs 6.8)上的Django安装错误
Django安装有问题,不幸的是在网络中没有找到关于同一个bug的任何信息。当我尝试第一次迁移django数据库时,我得到了这样一个输出:Python2.7(centOs 6.8)上的Django安装错误,django,python-2.7,centos6,Django,Python 2.7,Centos6,Django安装有问题,不幸的是在网络中没有找到关于同一个bug的任何信息。当我尝试第一次迁移django数据库时,我得到了这样一个输出: > python manage.py migrate Traceback (most recent call last): File > "manage.py", line 23, in <module> > execute_from_command_line(sys.argv) File "/etc/netwo
> python manage.py migrate Traceback (most recent call last): File
> "manage.py", line 23, in <module>
> execute_from_command_line(sys.argv) File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 367, in execute_from_command_line
> utility.execute() File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 359, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv) File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/core/management/base.py",
> line 294, in run_from_argv
> self.execute(*args, **cmd_options) File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/core/management/base.py",
> line 345, in execute
> output = self.handle(*args, **options) File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/core/management/commands/migrate.py",
> line 83, in handle
> executor = MigrationExecutor(connection, self.migration_progress_callback) File
> "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/db/migrations/executor.py",
> line 20, in __init__
> self.loader = MigrationLoader(self.connection) File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 52, in __init__
> self.build_graph() File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 203, in build_graph
> self.applied_migrations = recorder.applied_migrations() File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 65, in applied_migrations
> self.ensure_schema() File "/etc/network/scripts/learning_log/ll_env/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 59, in ensure_schema
> raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
> django.db.migrations.exceptions.MigrationSchemaMissing: Unable to
> create the django_migrations table (near "BGN": syntax error)
>python manage.py迁移回溯(最近一次调用last):文件
>“manage.py”,第23行,在
>从命令行(sys.argv)文件“/etc/network/scripts/learning\u log/ll\u env/lib/python2.7/site packages/django/core/management/\uuuu init\uuuuuu.py”执行“,
>第367行,从命令行执行命令
>utility.execute()文件“/etc/network/scripts/learning\u log/ll\u env/lib/python2.7/site packages/django/core/management/\uuuuu init\uuuu.py”,
>第359行,执行中
>self.fetch_命令(子命令)。从_argv(self.argv)文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/core/management/base.py”运行_“,
>第294行,来自argv的运行中
>self.execute(*args,**cmd_options)文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/core/management/base.py”,
>执行中的第345行
>output=self.handle(*args,**选项)文件“/etc/network/scripts/learning\u log/ll\u env/lib/python2.7/site packages/django/core/management/commands/migrate.py”,
>第83行,在手柄中
>executor=MigrationExecutor(连接、self.migration\u进程\u回调)文件
>“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/db/migrations/executor.py”,
>第20行,in_uuuinit__
>self.loader=MigrationLoader(self.connection)文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/db/migrations/loader.py”,
>第52行,in_uuuinit__
>self.build_graph()文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/db/migrations/loader.py”,
>第203行,内置图
>self.applicated_migrations=recorder.applicated_migrations()文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/db/migrations/recorder.py”,
>第65行,在应用程序迁移中
>self.sure_schema()文件“/etc/network/scripts/learning_log/ll_env/lib/python2.7/site packages/django/db/migrations/recorder.py”,
>第59行,在模式中
>raise MigrationSchemaMissing(“无法创建django_迁移表(%s)”%exc)
>django.db.migrations.exceptions.MigrationSchemaMissing:无法
>创建django_迁移表(靠近“BGN”:语法错误)
这个“BGN”:语法错误我在任何地方都找不到。pip安装或来源(无论是在venv中还是不在venv中)也存在同样的问题。有没有办法解决这个问题?看起来像是DB的连接问题。请参阅并尝试我的部分配置数据库={'default':{'ENGINE':'django.db.backends.sqlite3','NAME':os.path.join(BASE_DIR,'db.sqlite3'),}}}文件db.sqlite3是在venv目录中创建的,但随后我无法运行服务器,出现相同的错误。可能是发动机有问题?我如何调试它?不幸的是,我没有postgresql,只有sqlite。看来这不是我的情况。