CI/CD Django | Dev & Prod Environments

Hi,
I created a Django app which is ready for production, in containers. (one for appdata, one for nginx and one for postgresdb).
although, I quite challenged in finding the best practice way to maintain a dev-version and a prod-version.
For example, I want to add some new models - what is the best way to see if it all works and then how can I push the changes to the production once its done?
remember that I need to change the DB itself, and to build containers and see if the website is all good before i can push changes…
Should I use a regular git branches for every change?

Thanks!

We keep what we refer to as a “staging system”. Everything is deployed and tested on that server before being elevated to production. (Every developer has their own development environment, then there’s the QA area, where the testers get to review it, then there’s the staging envrionment, and then there’s production.)

That’s up to you. That’s a management decision and not a technical one.

I’m very new at this, and made this app by myself. Is there anything you can advise me? how can i create my own staging system with a django app in a containers?

It’s just another deployment environment. In our case, it’s a replica of the production environment.

That’s one of the beauties of containers. If you create a separate “docker net” for each set of containers, you can run multiple sets on the same system. Our “staging system” is actually right now running 6+ separate projects, where each project consists of containers for Django, Celery, Beat, Redis (or memcached), nginx, and possibly others. (They all share the same PostgreSQL instance running on the host.)

I just realized that you might be running your containers in a managed environment - you might not be managing your own docker system. In that case, you’ll need to see what facilities they may make available to you.