Hi Vincent.

On Mar 14, 5:16 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Does anyone have tricks to make this process a bit more efficient and
> not catastrophic in case we forget to copy the settings.py file?

I use conditionals inside my settings.py so that one lot of paths/
settings get used on the dev server and another lot get used on the
live server.  You could check automatically if the machine is the dev
server and if not, use the settings for the live server.  That way the
settings get overwritten intentionally.

e.g.

# Check if we are running on the dev server.
# Defaults to using live settings in case live server name changes.
DEV_HOSTNAME = 'dev-server'
from socket import gethostname
LIVE = gethostname() != DEV_HOSTNAME

if LIVE:
    DATABASE_ENGINE = 'postgresql_psycopg2'
    ...etc
else:
    DATABASE_ENGINE = 'sqlite3'
    ...etc

One thing to consider when serving a working copy is all those .svn
directories could be accessible via your web server.  Assuming your
code isn't within your web server's root (which it shouldn't be),
there's probably not much that can go wrong.  Still, it might be worth
checking if you can see anything interesting with something like:

http://www.example.com/myapp/.svn/text-base/

I normally prefer an svn export instead of serving a working copy, for
that reason.

Scott


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to