Re: Static/media url in template

2011-04-05 Thread Jon J
N/M, I solved it. I found this little gem: from django.template import RequestContext [code...] return render_to_response('base.html',locals(), context_instance = RequestContext(request)) which gives me access to the URL from the templates. This should definitely be in the docume

Re: Static/media url in template

2011-04-05 Thread Ryan Osborn
You need to have *django.core.context_processors.media* in your TEMPLATE_CONTEXT_PROCESSORS setting in order to use this template tag. The same with STATIC_URL, you need to have * django.core.context_processors.static* in order to use it. Hope this helps, Ryan -- You received this message be

Re: Static/media url in template

2011-04-05 Thread Daniel Roseman
On Tuesday, April 5, 2011 3:39:17 PM UTC+1, JohnnyWalker wrote: > > It doesn't appear that simple. When I try to insert {{MEDIA_URL}} into > my template, I get no output whatsoever. I haven't been able to find > anything on this. You don't seem to be looking very hard. http://docs.djangoproject.

Re: Static/media url in template

2011-04-05 Thread Jon J
It doesn't appear that simple. When I try to insert {{MEDIA_URL}} into my template, I get no output whatsoever. I haven't been able to find anything on this. On Mon, Apr 4, 2011 at 7:49 PM, Sam Walters wrote: > Yes it already exists {{MEDIA_URL}} > > Thats what the settings.py file does... > > Th

Re: Static/media url in template

2011-04-04 Thread Sam Walters
Yes it already exists {{MEDIA_URL}} Thats what the settings.py file does... There is a bunch of stuff you can read about in the docs: http://docs.djangoproject.com/en/1.3/howto/static-files/ Also for some of my own deployments there are a bunch of static file servers so i just put these into se

Static/media url in template

2011-04-04 Thread Jon J
Maybe I'm missing something... I would say I'm relatively familiar with the Django framework by this point. I'm mocking up a website, and I want to link static files into the base template. Instead of having the url's directly in the template, I'd like to call the STATIC_URL variable from within t