我部署了我的Django应用程序,当我尝试使用它时
heroku run python manage.py syncdb
我遇到了等待进程超时的错误。虽然我使用了 syncdb 命令,但超级用户尚未为系统创建。
heroku run:detached python manage.py createsuperuser
但是这并没有提示我要求超级用户权限。
在我的系统中,端口5000没有被阻止。我该如何使Heroku运行起来(或者)如何创建超级用户?
我部署了我的Django应用程序,当我尝试使用它时
heroku run python manage.py syncdb
我遇到了等待进程超时的错误。虽然我使用了 syncdb 命令,但超级用户尚未为系统创建。
heroku run:detached python manage.py createsuperuser
但是这并没有提示我要求超级用户权限。
在我的系统中,端口5000没有被阻止。我该如何使Heroku运行起来(或者)如何创建超级用户?
不要断开Heroku Shell连接:
heroku run python manage.py createsuperuser
对我有效
heroku run python manage.py migrate
迁移数据库,仅在调用 createsuperuser
命令之前未迁移数据库时才需要这样做。 - Erion Sheroku run python manage.py syncdb
不能在机构或公司局域网上运行,若要运行此程序,您必须先取消系统代理。
unset http_proxy
`unset https_proxy`
我希望这会有所帮助。
尝试
heroku run python manage.py shell
然后从那里创建您的超级用户。祝你好运!
heroku run bash
命令,然后执行 python manage.py shell
命令。 - Erik请提供更多信息。
您使用的数据库是什么?
您是否已经设置了local_settings.py?
您是否使用Debian?
我在Debian上使用Postgres,因此我需要执行apt-get install python-psycopg2
(否则无法使用postgres)和pip install --user psycopg2
(否则pip freeze
将忽略Postgres),然后手动创建用户和数据库。将USER替换为local_settings.py中的用户名。
sudo su - postgres
createuser USER -dPRs
createdb --owner USER db.db
heroku logs
,您的 requirements.txt 文件可能存在问题。 - fasoutocreatesuperuser
,不带空格。 - fasoutoheroku logs
吗? - Rob Grant