Newbie question who prepares for first project which will be Django based.
If you have some resource on the below question let me know.
I am trying to imagine how things works:
Maintaining mirrored environment:
1) How do you make sure developement and production servers are exacly same(mirrored)? To precise the question, does this include:
- updates of operating system on both machines ?
- updates of enviromental programs/application at pretty much the same time?
- anything else?
2) One thing Django recommends is to keep requirements.txt of every installed plugin/app in the virtualenv.
Is 1) and 2) enough?
3) Is there a way to check if environments are identical if you get lost?
4) As best practice does production and developement databases need to be the same type database to test? For example Django as a default uses SQLite and I will be using different database on the production.
Problem, messing up.
5) Lets say I messed up with developement.
a) How do I mirror all environment and application from production.
b)Do I create same environment on the developement first and then copy the appliccation files from production? Is standard FTP enough? Or instead of a copy of the application files do I need to create packages of my application first or maybe do I transfer the whole project package to the production.
c) Or maybe I get back to last working git version that should also be on the production.
4) Do I constantly need to care working with some version control applications like Git? My guess, definietely.
Most silly question at the end anyway. 🙂
5) Would you update third party apps or just leave them. If yes, whenever possible or from time to time.
6) Would you update Python or Django or in general programming language? I guess it is not something to do unless it is really outdated.
7) How do I make an update of the website? In other words which code do I migrate from production to developement after making an update. Only the files I have changed? Or whole newest working git version I am happy with.
a) I assume regular system updates are just a routine task and writing a script to do is one of the practice.
b) Do I update system when I am in virtualenv or not in virtualenv?
9) How to take off working application off the server and replace it with some information screen when making updates?
11) Do I somehow disconnect database from application when making updates. Most silly question at the end. 🙂
12) I will be keeping backups on the same server on the beginning and occasional migration of database to third party will be done as well. Is that reasonable?