mardi 31 janvier 2017

Setting up Django development, test, and production environments

I am setting up a CentOS server with Apache and it got me wondering about how to setup development, testing, and production environments and how to setup the settings.py files.

For the development environment, I was going to develop on the local computer, use the Postgres test database on the CentOS machine, and use runserver as the web server. When done coding, I was going to push to Git.

For the testing environment, was going to pull, or clone, from Git to the CentOS server. I was going to have the test app running on 8080 and using the Postgres test database.

For the production environment, would run on 80 and use the production Postgres database.

Now these questions might seem to have pretty obvious answers, but feel the need to ask for clarity:

1) The production and testing directories will need to be completely separated from one another, correct? Obviously if they share the same directory and issues that come up during testing will be present in the production env which would be bad.

2) In Apache, it would need to be setup to serve the test environment on 8080 and point to the test directory for the test app. Then there would need to be the one for production on port 80 point at the production directory for the production app, correct?

Just looking to confirm my thinking on the subject.

Aucun commentaire:

Enregistrer un commentaire