Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

Contextual (via) I’ve been trying to figure out a sane way to replace Django’s settings.py global module with something that’s designed to be reconfigured at run-time. Contextual appears to be trying to solve exactly that problem.

Tagged , , , ,

4 comments

  1. I would be a very happy camper if I could use this to do something like:

    with Settings.new():
        # Some logic to choose settings based on the request
        Settings.load('some/runtime/settings.py')
        Settings.DATABASE_NAME = 'my_choice' 
        application = django.core.handlers.wsgi.WSGIHandler()

    Wes Winham - 12th May 2009 14:47 - #

  2. It's possible to change settings at run-time, isn't it?

    墨尔本 - 13th May 2009 04:45 - #

  3. Sort of. Some settings can be changed at run time, some can't. Figuring out which ones can isn't exactly straight forward. You have to be very careful about thread safety. It also feels really dirty whenever you do it.

    Simon Willison - 13th May 2009 08:16 - #

  4. This looks like a very useful library. Once Django 1.2 planning starts, I'd also love to see this discussed for the roadmap..

    Max Battcher - 13th May 2009 09:31 - #

Comments are closed.
A django site