Friday, March 29, 2013

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

Hi, Surya!

My practice is to have 'settings_template.py' in repository and
'settings.py' ignored, so 'settings.py' looks like:

from settings_template import *

# and here's confidential settings and other

There also may be many 'templates' for settings, like
'settings_dev.py', 'settings_production.py', but 'settings.py' is
always created on the host and never pushed to repo. And in addition
to that there may be an example file in repo, like
'settings.py.example'.


Regards,
Alex
///

On Fri, Mar 29, 2013 at 12:11 PM, surya <kasturisurya@gmail.com> wrote:
>
>
> On Friday, March 29, 2013 1:10:12 PM UTC+5:30, surya wrote:
>>
>> 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!
>>
>
> In simple words..
>
> There is a file (local-settings.py) in a local branch, should be ignored
> while pushing in github, but should be pushed into server.. :p .
>
> Hope this seems lot complex.. any simple ideas? (the less the manual work,
> the better.. )
>
> --
> 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.
>
>

--
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