Robert
Robert

Reputation: 13

Django 1.3 - RequestContext not rendering to template

I am trying to simply render {{ request.user }} from my base template and for whatever reason it is not rendering anything. I have even tested trying to return {{ request }} to no avail.

I am currently using django-annoying to render to the template (render_to) and have tried to switch back to using django.templates.RequestContext and that hasn't worked either.

I have a feeling it has something to do with caching, but I have edited my template to show test - {{ request }} and "test - " shows up just fine.

I have also tried to upgrade my django to 1.4 alpha to see if it resolves my issue.

This does not send the request to the template

@render_to('profile/index.html')
def home(request):
    return {}

This works

@render_to('profile/index.html')
def home(request):
    return {'request': request}

However, if I pass 'request': request into the template everything works.

Link to settings.py

I can give any more information that is requested.

Upvotes: 1

Views: 910

Answers (1)

bradley.ayers
bradley.ayers

Reputation: 38382

You need to add the django.core.context_processors.request context processor.

Upvotes: 4

Related Questions