sotirac wrote:
> Just trying to get a feel for what other developers are doing when
> deploying to a production server. There are some differences between
> my development machine and production server such as the location of
> my media files, the database settings, and if I want to enable caching
> or not. Right now my option is to comment out some of the code and
> uncomment the other values. This is time consuming and error proned.
> How do you deal with this issue of working in your development machine
> and then having to deploy the same code into your production server.
>
> Some files I modify are the settings.py/url.py/views.py.
I use hostname-based automatic configuration.
I place settings shared across my local dev box and remote host in
`settings.py`, and in `site_settings.py` I use something like that:
from socket import gethostname
hostname = gethostname()
if hostname == dev_box_host':
# set VAR1, VAR2 etc.
elif hostname == 'remote_host':
# set VAR1, VAR2 etc.
One may place settings for each site in separate module, use
`__import__` to load the appropriate settings, etc.
--
Happy Hacking.
http://sphinx.net.ru
む
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---