Monday, June 28, 2010

context porcessors request.context media_url breaks admin

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_processors.media_url',)

context_processors.py
def media_url(request):
from django.conf import settings
return {'media_url': settings.MEDIA_URL}

urls.py
from django.template import RequestContext

urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^work/$', 'django.views.generic.list_detail.object_list',
dict(info_dict, template_name="portfolio/projects_list.html")),
)

and when I remove it the admin works, but I have no media_url
reference

Any suggestions please?

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate