On 29/03/2010 7:50am, Guillermo wrote:
Hi,
I'm working on a project with multiple programmers for the first time,
and I'm not sure how I should go about commiting the Django project's
setting file to the public repo. Since it can contain sensitive data,
how's this done usually so everybody works with the same settings
during development?
Guillermo
I write a little fetcher method which runs inside settings.py so I don't
have to put credentials in the repository.
I keep all credentials in separate files in a credsdir and call
settings.getcreds() for anything I need inside Django. credsdir still
needs to be invisible in the filesystem to every user except the http
server - chmod 700. If something was seriously sensitive you could use
SSL/TLS and get your credentials from a secure server.
credsdir = '/srv/www/' + APP + /creds/'
creds =credsdir + APP +'.cred'
def getcreds(fname=creds):
#The first line of creds is user, next is password
fh = open(fname,'r')
cred = [fh.readline().strip(), fh.readline().strip()]
fh.close()
return cred
You choose your location according to location of your devs.
Mike
Cheers,
Guillermo
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.