On Thu, Jul 8, 2010 at 8:21 AM, justin jools wrote:
> Wow... django docs can be so confusing...
>
> I could not believe it worked just by using upper case MEDIA_URL
{{ MEDIA_URL }} is already present in the templates because the
django.core.context_processors.media context processor which
is ena
Wow... django docs can be so confusing...
I could not believe it worked just by using upper case MEDIA_URL
Thanks so much :) :)
I spent a day trying figure this out...
On 8 July, 13:14, Daniel Roseman wrote:
> On Jul 8, 12:57 pm, justin jools wrote:
>
>
>
>
>
> > Thank for your quick response
The 2 methods of using media_url with generic views I have tried:
1.
http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/
This knocked out my admin, but media_url did work
2. using templatetags
yourApp/templatetags/media_url.py:
from django.template import Library
f
On Jul 8, 12:57 pm, justin jools wrote:
> Thank for your quick response Daniel.
> I'm just confused about using media_url with generic views, I have
> done it previously with:
>
> from django.conf import settings # for media_url
> media_url = settings.MEDIA_URL
>
> def dblist(request):
>
Thank for your quick response Daniel.
I'm just confused about using media_url with generic views, I have
done it previously with:
from django.conf import settings# for media_url
media_url = settings.MEDIA_URL
def dblist(request):
obj_list_menu = dbModel1.objects.all()
return rende
On Jul 8, 11:40 am, justin jools wrote:
> Thanks for that. I did read something about having to add services
> back in to the context processors.
> The reason I am doing this way is because I could not pass the {media
> url} with generic views.
> I did a search for trying to do this and hit a coup
Thanks for that. I did read something about having to add services
back in to the context processors.
The reason I am doing this way is because I could not pass the {media
url} with generic views.
I did a search for trying to do this and hit a couple of posts saying
it is not possible to use {media
On Jun 29, 1:41 pm, justin jools wrote:
> Hi Tom if you read my original post you will realise that the error is
> being caused by setting of context processors to media_url (see
> original post).
> When context processors are active the {media_url} tag works
> perfectly, but breaks the admin.
>
>
Hi Tom if you read my original post you will realise that the error is
being caused by setting of context processors to media_url (see
original post).
When context processors are active the {media_url} tag works
perfectly, but breaks the admin.
If I comment out :
settings.py
#TEMPLATE_CONTEXT_PROC
On Tue, Jun 29, 2010 at 12:33 PM, justin jools wrote:
> I corrected my settings.py links:
>
> TEMPLATE_DIRS = 'C:/django/portfolio_root/templates/'
> MEDIA_ROOT = 'C:/django/portfolio_root/site-media/'
> MEDIA_URL = '/site-media/'
> ADMIN_MEDIA_PREFIX = '/media/'
>
> but I still get this error:
>
I corrected my settings.py links:
TEMPLATE_DIRS = 'C:/django/portfolio_root/templates/'
MEDIA_ROOT = 'C:/django/portfolio_root/site-media/'
MEDIA_URL = '/site-media/'
ADMIN_MEDIA_PREFIX = '/media/'
but I still get this error:
TemplateSyntaxError at /admin/
Caught an exception while rendering: us
Yes I did accidentally set my
ADMIN_MEDIA_PREFIX = '/site-media/' instead of media
I'll try this
On Jun 29, 8:57 am, bruno desthuilliers
wrote:
> On 29 juin, 00:44, justin jools wrote:
>
>
>
>
>
> > I am trying to use media_url with generic views:
> > When I set context processors to media_url
On 29 juin, 00:44, justin jools wrote:
> I am trying to use media_url with generic views:
> When I set context processors to media_url, with generic views it
> breaks Admin:
>
> Caught an exception while rendering: user
>
> settings.py
> TEMPLATE_CONTEXT_PROCESSORS =
> ('portfolio.context_processo
13 matches
Mail list logo