On Thu, 2009-02-26 at 17:04 -0800, AKK wrote:
> Hi,
> 
> I have a template and I want to get some images out of my media root.
> I was wondering is there anyway to automatically return the media root
> from settings.py rather than manually specifying it rather each time.

You are probably wanting the MEDIA_URL setting, not the one called
MEDIA_ROOT. The former setting is the one that allows external users
(e.g. web browsers) to retrieve the media. The latter only describes
where they are stored, locally (not a useful piece of information to
external consumers).

Given that, look at the "media" context processor:
http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-media

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