【问题标题】:Get Django South working on Heroku with custom user models?让 Django South 使用自定义用户模型在 Heroku 上工作?
【发布时间】:2013-06-28 20:30:30
【问题描述】:

我正在努力让 Django 南下,以便在 Hereoku 上工作。感谢this 示例,这似乎并不难。但是,我正在为bug in south 使用一种解决方法,当在 Django 中使用自定义用户模型时,它会阻止向南启动。

我在本地使用以下 south 命令来启动 South(解决方法):

python manage.py syncdb
python manage.py convert_to_south myapp
python manage.py migrate myapp 0001 --fake

之后我将代码推送到 Heroku 并在 Heroku 上尝试了以下步骤:

python manage.py syncdb // this didn't sync the south apps
python manage.py convert_to_south myapp 
// This gave the error saying that the apps were already added to south

我的第二次尝试(在 Heroku 数据库重置和新推送之后):

python manage.py syncdb // this didn't sync the south apps
python manage.py migrate 
// Same south error as described in the south bug ticket

有没有人可以把我引向正确的方向?

【问题讨论】:

    标签: django heroku django-south migrate


    【解决方案1】:

    我已经在很多地方搜索过答案,但唯一的解决方案似乎是在本地生成迁移文件并将它们推送到 Heroku。这是我希望我能阻止的事情,但这是唯一可行的选择。

    希望从 Django 1.7 开始,当迁移被内置到 Django 中时,这将得到解决。在那之前,我离开了 Heroku。

    【讨论】:

    • 为什么要避免在本地生成迁移?它们应该在您的存储库中。
    猜你喜欢
    • 2012-04-01
    • 1970-01-01
    • 2014-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-01
    • 1970-01-01
    • 2011-12-12
    相关资源
    最近更新 更多