Re: Best practise for using settings in templates

2009-01-19 Thread Fergus
Or you can set up a custom template tag that returns settings values if you only want the settings on particular pages, and don't want to add boilerplate to each view, or have the overhead of a context processor. On Jan 18, 12:25 pm, phoebebright wrote: > Thanks - learning more every day! > > O

Re: Best practise for using settings in templates

2009-01-18 Thread phoebebright
Thanks - learning more every day! On Jan 18, 11:37 am, Malcolm Tredinnick wrote: > On Sun, 2009-01-18 at 03:26 -0800, phoebebright wrote: > > What is best practise if you want to use a variable defined in > > settings.py in a template? > > Pass it in via the view or call it directly in the templ

Re: Best practise for using settings in templates

2009-01-18 Thread Malcolm Tredinnick
On Sun, 2009-01-18 at 03:26 -0800, phoebebright wrote: > What is best practise if you want to use a variable defined in > settings.py in a template? > Pass it in via the view or call it directly in the template? Since you can't access it directly in a template, that leaves only the former option

Best practise for using settings in templates

2009-01-18 Thread phoebebright
What is best practise if you want to use a variable defined in settings.py in a template? Pass it in via the view or call it directly in the template? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: using settings in templates

2008-12-06 Thread Jeff FW
You can pass the settings object into your context when you render your template, or you can write a context processor that adds the settings object to the template's context. Take a look at the docs on context processors, especially the section about writing your own: http://docs.djangoproject.c

using settings in templates

2008-12-06 Thread barracuda
Hello, How can I use a configuration in settings in templates? For e.g , I would like to use the DATE_FORMAT configured in settings to format the database datetime in a template Here: {{db_time|date:"D d M Y" }} I want to get the format from settings. Thanks! --~--~-~--~~