Commit 6ccfd87e by Ernie Park

merge

parents a6977aae 472a3996
...@@ -2,6 +2,7 @@ import json ...@@ -2,6 +2,7 @@ import json
import hashlib import hashlib
from lxml import etree from lxml import etree
from mako.template import Template
try: # This lets us do __name__ == ='__main__' try: # This lets us do __name__ == ='__main__'
from django.conf import settings from django.conf import settings
...@@ -89,7 +90,10 @@ def id_tag(course): ...@@ -89,7 +90,10 @@ def id_tag(course):
def course_file(user): def course_file(user):
# TODO: Cache. # TODO: Cache.
tree = etree.parse(settings.DATA_DIR+UserProfile.objects.get(user=user).courseware) filename = settings.DATA_DIR+UserProfile.objects.get(user=user).courseware
data_template = Template(filename=filename)
tree = etree.XML(data_template.render())
id_tag(tree) id_tag(tree)
return tree return tree
......
...@@ -3,6 +3,10 @@ import sys ...@@ -3,6 +3,10 @@ import sys
import djcelery import djcelery
# Configuration option for when we want to grab server error pages
STATIC_GRAB = False
DEV_CONTENT = True
LIB_URL = '/static/lib/' LIB_URL = '/static/lib/'
LIB_URL = 'https://mitxstatic.s3.amazonaws.com/js/' LIB_URL = 'https://mitxstatic.s3.amazonaws.com/js/'
BOOK_URL = '/static/book/' BOOK_URL = '/static/book/'
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
from mitxmako.shortcuts import render_to_response, render_to_string from mitxmako.shortcuts import render_to_response, render_to_string
from django.shortcuts import redirect from django.shortcuts import redirect
from django.core.context_processors import csrf from django.core.context_processors import csrf
from django.conf import settings
#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', valid_templates=['mitx_global.html',
...@@ -13,7 +14,15 @@ valid_templates=['mitx_global.html', ...@@ -13,7 +14,15 @@ valid_templates=['mitx_global.html',
'tos.html', 'tos.html',
'privacy.html', 'privacy.html',
'honor.html', 'honor.html',
'copyright.html'] 'copyright.html',
'404.html']
print "!!",settings.__dict__
if settings.STATIC_GRAB:
valid_templates = valid_templates+['server-down.html',
'server-error.html'
'server-overloaded.html']
def index(request, template): def index(request, template):
csrf_token = csrf(request)['csrf_token'] csrf_token = csrf(request)['csrf_token']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment