简体   繁体   中英

How do you view your PostgreSQL database and tables that are part of a Django app that has been uploaded to Heroku?

  1. Built a Django app locally. Worked fine.
  2. Uploaded to Heroku which appeared to be successful.
  3. However "user" table is evidently corrupted. I cannot login or create users without errors on Django app on Heroku.
  4. I want to modify (specifically delete) rows in the "user" table of the PostgreSQL database on Heroku. How can I do that?
  5. I ran the following from the CLI without success:
    heroku run python manage.py makemigrations
    heroku run python manage.py migrate

I will suggest the below steps:

  1. Open Heroku got to the project page, press on resources.
  2. Under Add-ons you will find Heroku postgres (which is you're database) press on it.
  3. on Database go to settings get the credentials and connect to your database using pg-Admin by connecting to Heroku database using pg-Admin.
  4. In pg-Admin set the credentials for Heroku database but please don't forget to set the DB restrection in advance tab to connect only to your database on Heroku otherwise, you will get a list of DB you don't know why. Now you can work with your remote DB on heroku using pgadmin. please check the below pics for the config server in pgadmin

enter image description here enter image description here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM