2👍
✅
Review what context variable have. It should have something like that:
Example:
from django.template import RequestContext
def view(request):
...
return render_to_response(
"project_pages.html",
{'data':data},
context_instance=RequestContext(request),
)
1👍
For people coming here to look for django 1.8 or later should use the below code.
Now the template context processor is not picked from the setting.py file direclty, if you are writing custom views.
use the code below to make it work:
from sekizai.context import SekizaiContext
def view(request):
...
return render_to_response('template.html',
SekizaiContext(request, {'data': data}))
- [Django]-Testing for a ValidationError in Django
- [Django]-Integrating Pyjamas with Pinax+Django?
- [Django]-Django aggregation over annotated query
- [Django]-Web Leaderboard
0👍
I figured out.
In this template I have some information that i don’t wanna lose when a user press a button to submit some information to django to process, so I’ve made a function in javascript that allows to submit but doesn’t refresh the page.
With no refresh the content stays static and data variable from response isn’t send to template
Source:stackexchange.com