I followed the following documentation https://docs.digitalocean.com/tutorials/app-deploy-django-app/
My app has deployed fine however when I push changes that require me to run python manage.py makemigrations and python manage.py migrate I see the following…
after makemigrations i see the changes migrations being made
but when I run migrations it says there are no migrations…
Basically the posgres database does not update and I have to delete the database after every migration…
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!
Hello,
Do you have an additional App component for running your Django migration?
You could add the following to your app yaml file:
jobs:
- name: migrate
kind: PRE_DEPLOY
github:
repo: digitalocean/sample-django
branch: static
deploy_on_push: true
run_command: python manage.py migrate
envs:
- key: DISABLE_COLLECTSTATIC
value: "1"
scope: BUILD_TIME
- key: DATABASE_URL
value: "${db.DATABASE_URL}"
scope: RUN_TIME
For a reference, here is an example yaml file that contains all of the required components:
https://github.com/digitalocean/sample-django/blob/static/.do/app.yaml
Let me know how it goes!
Best,
Bobby
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.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.