I’ve deployed Django App on APP PLATFORM successfuly. My App requires the setup of Postgres DB Schemas … used with sub-domains in a multi tenancy application. I have setup a Managed Database [production]. How do I access this database so as to CREATE schemas?
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!
Hi @Softserveapps,
You can go to the database cluster overview page and fetch the Postgres database cluster connection string to connect.
The below links can guide you with connection to Postgres Managed database:
https://docs.digitalocean.com/products/databases/postgresql/how-to/connect/#connect-to-the-database
https://docs.digitalocean.com/products/app-platform/how-to/manage-databases/#connect-to-a-database
I hope this helps!
Regards, Rajkishore
I had the same issue deploying django multi tenant solution based on django-tenants. After doing some bit of digging i found out that the db_user created from the control panel have minimal permissions based on DO ‘principle of least privilege’ as defined in the documentation.
To fix this you need to connect to the cluster via psql defaultdb=> propt and grant permissions to your user using the following command GRANT CREATE ON DATABASE <your db> TO <your user>;
More on this you can referce the documentation here https://docs.digitalocean.com/products/databases/postgresql/how-to/modify-user-privileges/
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.