小编Pre*_*sse的帖子

Django:ProgrammingError:列"id"不存在

我尝试使用postgresql数据库(在我有SQLite之前),但是当我执行时我有一条消息python manage.py migrate:

Operations to perform:
Apply all migrations: sessions, admin, sites, auth, contenttypes, main_app
Running migrations:
Rendering model states... DONE
Applying main_app.0004_auto_20161002_0034...Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 345, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 348, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 399, in execute
output = self.handle(*args, **options)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py", line 200, in handle
executor.migrate(targets, plan, fake=fake, fake_initial=fake_initial)
File "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", …
Run Code Online (Sandbox Code Playgroud)

python django postgresql

9
推荐指数
1
解决办法
8361
查看次数

Django:导出SQL文件中的表

我尝试部署用 Django 1.9 开发的网站。我使用网络托管AlwaysData。

问题是我的网络托管数据库是空的(没有表),我想在此数据库中导入我的表(在 models.py 中)。

为此,我需要一个包含所有表的 sql 文件。之后我会将此文件导入到我的 AlwaysData 数据库中。

我尝试使用 dumpdata 命令,但 sql 格式不存在(只有 yaml、xml 和 json)。

我能怎么做 ?

我使用 PostGreSQL。

谢谢

python deployment django postgresql web-hosting

0
推荐指数
1
解决办法
2964
查看次数

标签 统计

django ×2

postgresql ×2

python ×2

deployment ×1

web-hosting ×1