Re: Media Root & Templates

2009-03-01 Thread Malcolm Tredinnick
On Sun, 2009-03-01 at 14:40 -0800, AKK wrote: > Is this what you mean? > > TEMPLATE_CONTEXT_PROCESSORS = ( > "django.core.context_processors.media" > ) If that's a cut-and-paste, then you need a trailing comma. In Python ("a") is not a 1-tuple, it's the string "a". ("a",) -- with a trailing

Re: Media Root & Templates

2009-03-01 Thread AKK
Is this what you mean? TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.media" ) regards, Andrew On 1 Mar, 18:33, Brian Morton wrote: > From the traceback, it would appear that one or more of your > processors is named or formed improperly.  Can you

Re: Media Root & Templates

2009-03-01 Thread Brian Morton
>From the traceback, it would appear that one or more of your processors is named or formed improperly. Can you post the code from your setting.py file where you specify your processors? Not just the strings, but the entire Python structure where you define those. On Mar 1, 7:51 am, AKK

Re: Media Root & Templates

2009-03-01 Thread AKK
Having looked at the traceback i gather its something to do with the imports: Environment: Request Method: GET Request URL: http://localhost:8080/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes',

Re: Media Root & Templates

2009-02-28 Thread AKK
Thank you. I had forgotten the context instance part but now i've added that as below: "render_to_response('blogSite/index.html', locals(), context_instance=RequestContext(request))" and i get: Exception Type: ValueError Exception Value: Empty module name but if i take out

Re: Media Root & Templates

2009-02-28 Thread Malcolm Tredinnick
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.

Re: Media Root & Templates

2009-02-28 Thread AKK
Actually i thought i have but i haven't, i added: TEMPLATE_CONTEXT_PROCESSORS = ( "django.core.context_processors.media" ) 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). Then when it didn't work i tried creating a simple

Re: Media Root & Templates

2009-02-28 Thread AKK
Managed to get it working. Thanks for the help. Andrew On 28 Feb, 00:36, Malcolm Tredinnick wrote: > On Fri, 2009-02-27 at 11:53 -0800, AKK wrote: > > Sorry I must mean the media url. Are the media_root and the media_url > > automatically linked? > > No. The

Re: Media Root & Templates

2009-02-27 Thread Malcolm Tredinnick
On Fri, 2009-02-27 at 11:53 -0800, AKK wrote: > Sorry I must mean the media url. Are the media_root and the media_url > automatically linked? No. The MEDIA_ROOT (capitalisation is important) setting is a storage path. It could be anywhere. It's then up to you to configure your webserver so that

Re: Media Root & Templates

2009-02-27 Thread AKK
Sorry I must mean the media url. Are the media_root and the media_url automatically linked? In my settings.py i have: C:/Program Files/Apache2.2/myproject/ media/ as the root & http://localhost:8080/akonline/media/ as the url and i have an image (imgs/img.jpg) in my

Re: Media Root & Templates

2009-02-26 Thread Malcolm Tredinnick
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

Re: Media Root & Templates

2009-02-26 Thread Chris Czub
if you include the django.core.context_processors.media context processor http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#django-core-context-processors-media On Thu, Feb 26, 2009 at 8:04 PM, AKK wrote: > > Hi, > > I have a template and I want

Media Root & Templates

2009-02-26 Thread AKK
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. Thanks Andrew --~--~-~--~~~---~--~~ You