Hey Django users,

So I've got a python file in my django app that I'm using to store some
configs in (to be global across several django apps), it's basically looks
something like this:

[ -- Contents of Config.py -- ]
VERSION = '0.1'
MEDIA_PREFIX = '/usr/local/dev-www/m/'
[ .. etc ...]

class u:
    "place to put user/login-specific configurations"
    MAX_LENGTH      = 64
    PASS_MIN_LENGTH = 10

[ ... and some other classes with the same sort of thing too ...]

Within views themselves, these are easy to access, e.g.,
Configs.u.MAX_LENGTH, but I'd like be able to easily pass EVERYTHING here to
templates.

So I'm wondering ... is there some easy/prescribed way (perhaps provided by
django itsself) to be able to turn this into a set of nested dictionaries
for use by a context processor?  So for example, I'd like to effectively end
up with:

   render_to_response('stuff.html',
            {
                 'config' : {
                      'VERSION' : '0.1'
                      'MEDIA_PREFIX' : '/usr/local/dev-www/m/'
                      # ... etc ...

                 }
            })

Thanks!
-John

--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to