2014-02-27 49 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'命令之前沒有遷移數據庫時才需要。 –