Use an additional file such "properties.py" or "local_settings.py" and put the credentials an other programmer specific information there and import that file on settings.py overriding the values o using:
import properties VALUE=getattr(properties, 'value', default_value) properties.py hasn't to be in the public repo, jus put a properties.py.template with example values, and let each developer to make his own copy with their values. 2010/3/28 Mike Dewhirst <mi...@dewhirst.com.au>: > 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. > > -- Antoni Aloy López Blog: http://trespams.com Site: http://apsl.net -- 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.