Friday, March 29, 2013

How to manage django settings.py for Github, local, production

Everyone talked about local, production settings.. 

try:
   from local_settings.py import *
except:
   # general settings.py 

my case needs three different settings: Github, local, production I have Django repo on github, and on pc (local). Now, need to push to another tree, the production server.

In our project, as its opensource, the master branch can't be directly pushed into Production server as it contains confidential settings.. For that I (admin of server) created a local branch to specifically contain production settings using local_settings.py.. The master is merged as into this branch as soon as we release new feature/ fix bug etc.. (any better way of handling. please tell me)

However, local_settings.py is included in .gitignore (remember, our master is on Github).. 
So, I need to edit .gitignore in local branch (containing production settings) and push to server..

As soon as I merge master into it..for adding new stable code, I need to update .gitignore (to track local_settings.py).. this is pathetic.. 

so.. i appreciate if you can provide a good working model!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment