Report this

What is the reason for this report?

How do I make my Django app in Dokku use Postgres dump as database?

Posted on May 6, 2014

Hi, I’ve recently uploaded my Django app to a Dokku droplet, and I want to know how I can make it to work with a dump of a database I have.

I’ve tried restoring to Postgres my dump but it’s not working, but, even if I where to restore data from dump, I still don’t know how can I make my app to use that database.

Could you tell me (baby steps) how can I make my Django app work with a Postgres database in Dokku droplet?

Thanks a lot!



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!

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.

This answer over on StackExchange seems relevant: <br> <br>http://stackoverflow.com/a/22763027 <br> <br>

Are you using the PostgreSQL plugin for Dokku? See: <br> <br>https://github.com/Kloadut/dokku-pg-plugin <br> <br>If so, you should be able to import a dump with: <br> <br><pre> <br>dokku postgresql:restore app_name < app.sql <br></pre> <br> <br>The key thing to remember is that Dokku runs the app from inside of a Docker container. So the database dump needs to be restored to the Postgres instance inside the container, not on the host system.

When I do it I find it answers with: <br> <br> Unknown (or too old) PostgreSQL container <br> <br>I’m not sure if I’m using the PostgreSQL plugin for Dokku, when I started the droplet, I selected the Dokku option (instead of Linux distribution, I selected it from application option), so I’m not sure where it comes from. <br> <br>

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.