I'd not seen that page before - there are some much better solutions
on there than my method. I particularly like Michael Radziej's
solution which uses the ConfigParser and a .ini file.

--Jon

On 8/14/07, larsholm <[EMAIL PROTECTED]> wrote:
>
> On top of above approach you can use ideas from
> http://code.djangoproject.com/wiki/SplitSettings to separate your
> settings into *common* and *deployment specific* settings. In this
> way, you won't need to edit the urls file (or have SVN to do it). Just
> setup a file on each deployment system specifying special settings,
> like db connection or live=true|false. Then just get settings.py to
> read the settings from this file.
>
> Cheers,
> Lars
>
> On Aug 14, 5:59 pm, "Ritesh Nadhani" <[EMAIL PROTECTED]> wrote:
> > Okay.
> >
> > That was most helpful. I think I will do the same. This is much more 
> > intuitive.
> >
> > On 8/14/07, Jon Atkinson <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > I've been experimenting with this too, and I've put a declaration of:
> >
> > > live = True
> >
> > > at the top of my urls.py file. Then the sections of my urls.py file
> > > which change between development and live are just put inside an if
> > > else block. Remember, all the files are interpreted, so this works
> > > quite well. An example:
> >
> > > from django.conf.urls.defaults import *
> > > from organisation.views import *
> >
> > > live = True
> >
> > > if live:
> > >         urlpatterns = patterns('',
> > >                 (r'^/mis/?$', 'mis.organisation.views.index'),
> > >         )
> > > else:
> > >         urlpatterns = patterns('',
> > >                 (r'^/?$', 'mis.organisation.views.index'),
> > >         )
> >
> > > I've written post-commit and post-checkout hook scripts for git
> > > (though you could do the same easily with SVN) which simple change the
> > > live = True to live = False or vice-versa as necessary.
> >
> > > Hope this helps.
> >
> > > --Jon
> >
> > > On 8/14/07, Ritesh Nadhani <[EMAIL PROTECTED]> wrote:
> >
> > > > Well, I can do that. I just wanted to know if that is the right way. I
> > > > have total control over the server as I am the admin. Just wanted to
> > > > follow the right way :)
> >
> > > > On 8/14/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
> >
> > > > > Why can't you mount it at root on the development and personal
> > > > > developer servers so it will match production? Use a different port
> > > > > just for Django if you really must because of the personal developer
> > > > > servers running other stuff. It is much easier to deal with it being a
> > > > > different port number than it being mounted at a different URL.
> >
> > > > > Graham
> >
> > > > > On Aug 14, 3:45 pm, acidity <[EMAIL PROTECTED]> wrote:
> > > > > > Hi
> >
> > > > > > This is more of a design question then anything.
> >
> > > > > > We are using Apache andmod_pythonin our development server. The
> > > > > > whole Django project is kept as subfolder in the Apache data
> > > > > > directory. So everybody out here can access it over:
> >
> > > > > >http://192.168.1.10/project
> >
> > > > > > The project is actually checked out from a subversion code 
> > > > > > repository.
> > > > > > Now every developer checks out the project on his individual machine
> > > > > > and works on it.
> >
> > > > > > A part of the urls.py:
> >
> > > > > > urlpatterns = patterns('',
> > > > > >     (r'^project/$', 'project.views.index'),
> > > > > >     (r'^project/login/$', 'django.contrib.auth.views.login',
> > > > > > {'template_name': 'accounts/login.html'}),
> > > > > > )
> >
> > > > > > Now each development server while running their local copy, need to
> > > > > > access the project at:
> >
> > > > > >http://127.0.0.1:8000/projectandit works. Ideally, we would have
> > > > > > wanted onlyhttp://127.0.0.1:8000butwe can live with that.
> >
> > > > > > Now later on when we go live with, the website would be accessed 
> > > > > > from:http://www.domain.com. Now, during our testing it fails as the 
> > > > > > regular
> > > > > > expression will not match for top level.
> >
> > > > > > How do you manage such settings? In the end we will just checkout 
> > > > > > the
> > > > > > project in the data directory of Apache and it will go live.
> >
> > > > > > We dont want to change any settings between test and production so
> > > > > > that we dont miss anything or do any unrequired changes.
> >
> > > > > > Also, it may happen that the DB settings might be different too so
> > > > > > what would be the best way to manage such a setting?
> >
> > > > > > I am sure this is a very common setup.
> >
> > > > > > Ritesh
> >
> > > > --
> > > > Ritesh
> > > >http://www.riteshn.com
> >
> > --
> > Riteshhttp://www.riteshn.com
>
>
> >
>

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