Making 6.002 page main, moving static pages into static page framework

This commit is contained in:
pmitros
2012-01-13 16:57:06 -08:00
parent 55c10212f9
commit 1f2251c98c

View File

@@ -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('/')