From 1f2251c98cf214d6db5d0a12c2900cd157af9bf3 Mon Sep 17 00:00:00 2001 From: pmitros Date: Fri, 13 Jan 2012 16:57:06 -0800 Subject: [PATCH] Making 6.002 page main, moving static pages into static page framework --- static_template_view/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/static_template_view/views.py b/static_template_view/views.py index 89707d2a2f..b290f84473 100644 --- a/static_template_view/views.py +++ b/static_template_view/views.py @@ -5,12 +5,16 @@ from djangomako.shortcuts import render_to_response, render_to_string from django.shortcuts import redirect +from django.core.context_processors import csrf -valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html'] +#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html'] +valid_templates=['mitx_global.html', 'index.html'] def index(request, template): + csrf_token = csrf(request)['csrf_token'] if template in valid_templates: - return render_to_response(template,{}) + return render_to_response(template, {'error' : '', + 'csrf': csrf_token }) else: return redirect('/')