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 render_to_response('products/dblist.html', {'make_list': obj_list_menu, 'media_url': media_url }) but with generic views, have no views.py obviously, so I put it in settings.py: from django.conf import settings # for media_url media_url = settings.MEDIA_URL and in my base.html template: {{ media_url }}css/base.css but it's not picking it up? do i need to pass it with generic views? On 8 July, 12:35, Daniel Roseman <dan...@roseman.org.uk> wrote: > On Jul 8, 11:40 am, justin jools <justinjo...@gmail.com> 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 couple of posts saying > > it is not possible to use {media url} with generic views. > > > If you have a solution I would be happy to hear this. > > I'd be interested to know where you read this, because in fact the > opposite is true. Generic views all use the RequestContext, which > means they automatically gain access to all the existing context > processors - including the default > "django.core.context_processors.media" processor. So, all generic > views *already* have access to MEDIA_URL. > -- > DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@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.