2014-02-27 32 views
9

我部署了我Django应用程序,当我试图Heroku的Django应用程序createsuperuser

heroku run python manage.py syncdb 

我有一个超时等待过程中的错误。超级用户不会为系统创建的是,虽然我没有通过执行syncdb:

heroku run:detached python manage.py createsuperuser 

但这并不提示我的超级用户。

端口5000不会在我的系统中被阻塞。我如何让heroku运行(或)如何创建超级用户?

+0

检查你的日志'的Heroku logs',你可能有问题,你requirements.txt – fasouto

+1

此外,创建一个超级用户的语法是:'没有空格 – fasouto

+0

createsuperuser' @fasouto:我对requirements.txt没有问题。该应用程序正在工作,我也做了syncdb。唯一的问题是我无法创建超级用户。 –

回答

-1

尝试

heroku run python manage.py shell 

然后从那里创建超级用户。祝你好运!

+0

这就是我说的.. Heroku运行超时错误 –

+0

你说syncdb给你一个超时错误。 – Erik

+2

尝试'heroku运行bash',然后执行'python manage.py shell'。 – Erik

0

请更多信息。
你在用什么数据库?
您是否设置了local_settings.py?
您使用的是Debian吗?

我使用的Postgres Debian的,所以我不得不既apt-get install python-psycopg2(否则你无法使用Postgres的)和pip install --user psycopg2(否则pip freeze失误Postgres的),然后手工创建一个用户和数据库。浪费了整整一天我得到了答案

heroku run python manage.py syncdb 

不能在机构或办公室的局域网上运行运行这一点,你必须删除系统代理作为后从local_settings.py

sudo su - postgres 
createuser USER -dPRs 
createdb --owner USER db.db 
1

替换用户名USER以及

unset http_proxy 
`unset https_proxy` 

我希望这将有助于

+0

我欠你,你救了我的一天!永远不会想到这个...... –

25

不分离Heroku的她LL:

heroku run python manage.py createsuperuser 

工作对我来说

+4

确保使用'heroku run python manage.py migrate'迁移数据库,这只有在调用'createsuperuser'命令之前没有迁移数据库时才需要。 –