Question

How to view data in Web App managed database (PostgreSQL)?

I have a Django web app running on a basic web service ($10/mo). Along with that, I have deployed a static web app and a dev database ($7/mo). I also have a managed PostgreSQL database running ($15/mo).

I followed this tutorial to set the app up: https://www.digitalocean.com/community/tutorials/how-to-deploy-django-to-app-platform

I came to the realization that I am incurring unnecessary cost by running two databases, but am hesitant to destroy either of them for fear of deleting data or removing the database that is being used.

How do I determine which database is being used by the app, and what data is contained within each? Once I have figured out which holds the data and is necessary to the operation, I will delete the other.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hello,

The active database would be the one that is defined in your settings.py file.

Or if you are passing your database details as environment variables via your App directly, then you need to check the following variables to confirm which database your app is connecting to:

        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'myproject',
        'USER': 'myprojectuser',
        'PASSWORD': 'password',
        'HOST': 'localhost',
        'PORT': '',

In both cases, I could suggest taking a backup of your data before deleting the databases:

https://docs.digitalocean.com/products/databases/postgresql/how-to/import-databases/

Best,

Bobby