Do you write your own context processors?

If yes, you need to add 'django.core.context_processors.media' in
TEMPLATE_CONTEXT_PROCESSORS manually.

TEMPLATE_CONTEXT_PROCESSORS = (
    'django.core.context_processors.media',
)

Cheers,
Ivan



On Fri, Aug 20, 2010 at 4:07 AM, Greg Pelly <g...@munchly.com> wrote:
> Are your settings properly set up? Can you confirm that you are able to
> print settings.MEDIA_URL in your view?  MEDIA_URL defaults to the empty
> string, so that seems like the problem.  Then, pass in the request context
> as I described previously.
> From http://docs.djangoproject.com/en/dev/ref/templates/api/
> If TEMPLATE_CONTEXT_PROCESSORS contains this processor, every RequestContext
> will contain a variable MEDIA_URL, providing the value of the MEDIA_URL
> setting.
>
> Greg
>
> On Thu, Aug 19, 2010 at 10:54 AM, Bradley Hintze
> <bradle...@aggiemail.usu.edu> wrote:
>>
>> Greg, that didn't do it :(
>> Thanks though :)
>>
>> On Thu, Aug 19, 2010 at 1:43 PM, Greg Pelly <g...@munchly.com> wrote:
>> > try this:
>> > def math_form(request):
>> >   return render_to_response('form.html',
>> > {}, context_instance=RequestContext(request))
>> >
>> > greg
>> > On Thu, Aug 19, 2010 at 10:35 AM, Bradley Hintze
>> > <bradle...@aggiemail.usu.edu> wrote:
>> >>
>> >> I am sorry. I am using render to response.
>> >>
>> >>  #view.py
>> >>
>> >> def math_form(request):
>> >>    return render_to_response('form.html')
>> >>
>> >> #base.html
>> >>
>> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
>> >> <html lang="en">
>> >> <head>
>> >>    <title>{% block title %}{% endblock %}</title>
>> >> </head>
>> >> <body bgcolor = '#cc9900'>
>> >> <img src = "{{MEDIA_URL}}duke-logo.jpg">
>> >>    <center><h1>{% block header %}{% endblock %}</h1></center>
>> >>    <p>Please enter two numbers to add them.</p>
>> >>    {% block content %}{% endblock %}
>> >>    {% block footer %}
>> >>    <hr>
>> >>    <p>Thanks for visiting my site.</p>
>> >>    {% endblock %}
>> >> </body>
>> >>
>> >> On Thu, Aug 19, 2010 at 1:11 PM, Javier Guerra Giraldez
>> >> <jav...@guerrag.com> wrote:
>> >> > On Thu, Aug 19, 2010 at 12:03 PM, Bradley Hintze
>> >> > <bradle...@aggiemail.usu.edu> wrote:
>> >> >> So do I create 'my_data_dictionary'? and whats in there?
>> >> >
>> >> > are you using render_to_response()?  can't comment on your code if
>> >> > you
>> >> > don't show it
>> >> >
>> >> > --
>> >> > Javier
>> >> >
>> >> > --
>> >> > 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.
>> >> >
>> >> >
>> >>
>> >>
>> >>
>> >> --
>> >> Bradley J. Hintze
>> >> Graduate Student
>> >> Duke University
>> >> School of Medicine
>> >> 801-712-8799
>> >>
>> >> --
>> >> 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.
>> >>
>> >
>> >
>> >
>> > --
>> > Greg Pelly
>> > CEO / CTO, Munchly Inc.
>> >
>> > --
>> > 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.
>> >
>>
>>
>>
>> --
>> Bradley J. Hintze
>> Graduate Student
>> Duke University
>> School of Medicine
>> 801-712-8799
>>
>> --
>> 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.
>>
>
>
>
> --
> Greg Pelly
> CEO / CTO, Munchly Inc.
>
> --
> 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.
>

-- 
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.

Reply via email to