On Sat, 2009-02-28 at 15:13 -0800, AKK wrote:
> Actually i thought i have but i haven't, i added:
> 
> TEMPLATE_CONTEXT_PROCESSORS = (
>     "django.core.context_processors.media"
> )

Keep in mind that that will remove all the other context processors,
which might not be what you want.

        TEMPLATE_CONTEXT_PROCESSORS += (
           "django.core.context_processors.media",
        )
        
is safer.

> 
> to my settings.py (it didn't seem to be in there by default, i don't
> know if thats supposed to be the case).

It's intentional that it's not there by default. Not everybody needs
it / uses it and we try to keep things lean and mean with possibilities
for extension, rather than bloated and overweight just in case you might
need something.

> 
> Then when it didn't work i tried creating a simple template that just
> contained:
> 
> <html>{{ MEDIA_URL }}</html> just to see what its value was and it was
> empty (or at least nothing was printed out)

Did you use a RequestContext when calling render_to_response (or
Template.render())? Template context processors aren't run if you use a
normal Context -- again, they're not always required and they require
the "request" object in most cases, so there are two layers of contexts.
A common pattern for calling a view that uses context processors is:

        return render_to_response(template_name, {....},
            context_instance=RequestContext)
        
Again, this is all in the documentation for context processors.

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 
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