Hey there,
I'm having some trouble with my Django app on Azure with Postgres database. The app deploys successfully, and I am able to use it. However, I am unable to run management commands via SSH from the web app to update/migrate/change the database.
Specifically, I followed the instructions in the Django w/ Postgres to deploy my web application and everything went smoothly. On step 7 of the tutorial, there is a point where it asks you to log into the app via SSH and run 'python manage.py migrate' to create all the tables in the database. I did not have to do this step, as I already had a created database. For my instance, I used psql command line tool to access the azure database, and I restored a local backup onto azure.
That went fine, and the whole database is up and running. So I did not have to do that step.
The web app is deployed and has full access to the database, so things are running. Later I went into the SSH for the webapp, and it did not allow me to run any management commands saying:
django.db.utils.OperationalError: could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
I find this strange though as I've been googling around for answers and in most cases, it just means that the web app can't find the database. As in, it doesn't know where it is. But the web app deploys and accesses the database with no problem.
Any help would be awesome as I need to be able to run management commands from there to update my database.
Thanks,
Daniel