#10232: On development server, MEDIA_URL exists without setting
context_instance.
Works properly in mod_python.
------------------------------------+---------------------------------------
Reporter: chazmatazz | Owner: nobody
Status: closed | Milestone:
Component: Uncategorized | Version: 1.0
Resolution: worksforme | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Changes (by kmtracey):
* status: new => closed
* needs_better_patch: => 0
* resolution: => worksforme
* needs_tests: => 0
* needs_docs: => 0
Comment:
This report is a bit confusing because there is "Expected" and "What
should happen" as opposed to "Expected" and "Actual Results" or "What
happens" and "What should happen". Since your "Expected" seems to be,
rather, "Unexpected", I'm guessing you meant "What happens" there. It is
also unclear what you mean by "without setting context instance". You
mean passing no context into render_to_response? Passing a Context but not
a !RequestContext? Bare bones snippets of code could have clarified here.
At any rate I cannot recreate a problem here. Using these views:
{{{
#!python
from django.shortcuts import render_to_response
from django.template import RequestContext
def mq0(request):
return render_to_response('mq.tmpl')
def mq1(request):
return render_to_response('mq.tmpl', {'view_name': 'mq1'})
def mq2(request):
return render_to_response('mq.tmpl', RequestContext(request,
{'view_name': 'mq2'}))
}}}
and this mq.tmpl:
{{{
View: {{ view_name }}
Media_url: {{ MEDIA_URL }}
}}}
only the mq2 view displays the MEDIA_URL value that is set in settings.py,
as expected since the context processor that does this is documented to
only affect !RequestContexts. Tested using the development server on
trunk r9817.
--
Ticket URL: <http://code.djangoproject.com/ticket/10232#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---