2012-10-04 51 views
1

我正在部署一个现有的Django项目(与多个应用程序)到Heroku。我遵循了Heroku docs中的步骤。当我运行heroku run python manage.py syncdb我得到以下错误:heroku syncdb现有的Django项目与多个应用程序

Running `python manage.py syncdb` attached to terminal... failed 
! No app specified. 
! Run this command from an app folder or specify which app to use with --app APP. 

我尝试了这些建议,但问题仍然存在。另外,我想知道是否有办法为所有现有的应用程序自动创建数据库表,而无需指定每个应用程序。

我也使用南,我仍然不知道如何正确地将我的迁移转移到Heroku。也许这是问题的一部分?

+0

您是否在您项目的主目录中?你能否成功运行“git push heroku master”? – dannyroa

+0

我是。不过,我一直在研究二级分支(所以我不会太过分)。我一直在推'git push heroku secondary_brach_name:master'。这可能是问题吗? – Rob

回答

2
git remote add heroku [email protected]:{YOUR_APP_NAME}.git 
git config heroku.remote heroku 

app正在这里所指的是不是你的Django应用程序,但您的项目名称。

+0

我不认为这是问题所在。那个遥控器已经存在了我。 – Rob

+0

你有超过1个git remote吗? –

+0

感谢您的帮助。我解决了这个问题,尽管我对它为什么起作用感到困惑。我不必从我的项目目录(我的manage.py所在的位置)运行命令,而必须上一个目录并执行'heroku run python my_django_project_name/manage.py syncdb' – Rob

相关问题