簡體   English   中英

Heroku Django Postgresql 數據庫管理員,超級用戶在哪里?

[英]Heroku Django Postgresql database admin, where is the super user?

我知道它很新手,但我剛開始使用heroku。 請多多包涵。

如果您在 heroku 上開發,它會為您提供 postgresql 用戶名和密碼。

但是,當您使用它從 django 管理頁面訪問它時,它會返回:

relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user..

我的問題是您需要做什么才能為管理頁面創建超級用戶?

提前致謝。

你可以這樣做

heroku run python manage.py migrate

代替

heroku run python manage.py syncdb

你可以從一次性測功機做到這一點

heroku run python manage.py syncdb

在你這樣做之前,請參閱https://devcenter.heroku.com/articles/getting-started-with-django#syncing-the-database

你必須先進行 makemigrations 並遷移

heroku run python manage.py makemigrations

heroku run python manage.py migrate

你必須開始創建超級用戶

heroku run python manage.py createsuperuser u



username :*florbert

password:######

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM