On Fri, Apr 23, 2010 at 8:38 AM, JohnHenry <qhlonl...@163.com> wrote:
> Hi, all
>    As I know, Django Templates got all variables through views
> function with Context dict; But I read some source, There is some
> variables like {{SITE_ROOT}} {{MEDIA_URL}} {{MEDIA_SERIAL}}
> {{request}}  {{ user }}  {{siteconfig}} ; Such variables seems globlly
> usable; But I can't find any Context Items about them in relative View
> function. Then How did those variables transimitted to Templates? And
> Can I add some global varible values like that which need no value
> from Context?
>
>
>
> Best Regards!
>

Those are added to the template context by the template context
processors which are run when you create a RequestContext - use a
Context, and there are none of them.

You can add your own template context processors, see
http://docs.djangoproject.com/en/dev/ref/settings/#setting-TEMPLATE_CONTEXT_PROCESSORS

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to