Report this

What is the reason for this report?

How to run management commands when deploying Django apps via the API?

Posted on November 16, 2020

Hi there,

When launching a Django app using the API of Digital Ocean App Platform, how do I programmatically run manage.py collectstatic and manage.py migrate after the deployment has finished?

thx! Gijs



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.

👋 @gijsnijholt

There are a couple options for running command after your app has been deployed:

  1. Manually go to the console tab in App Platform and run your commands on the same container as your service is running on
  2. Run a post deploy job: job documentation

Hope this helps!

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.