On Sun, 2007-10-07 at 16:21 +0000, niklas.voss wrote: > I searched around and haven't found anything about this Topic, so is > it possible to define Global Variables, which i can get in templates? > > So on my site i have a couple of settings, which are most time the > same and i didn't want to send them with every new app again with > render_to_response to the template, so i wan't a file or something > were i can define this constants. > > So is it possible to define Constants or Global Variables, which can i > get in every app? And is there a way to get them in the template, > without sending them with render_to_response?
Look at TEMPLATE_CONTEXT_PROCESSORS and use RequestContext instead of Context in your views. See [1] for lots of details. Remember to read the note about to pass RequestContext to render_to_response(). [1] http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---