Making 6.002 page main, moving static pages into static page framework
This commit is contained in:
@@ -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('/')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user