Commit abefb56d by bridger

Merge pull request #191 from MITx/template_caching

Template caching
parents 3ebd7587 dd6163db
......@@ -20,11 +20,12 @@ from django.shortcuts import redirect
from mitxmako.shortcuts import render_to_response, render_to_string
from django.core.urlresolvers import reverse
from django_future.csrf import ensure_csrf_cookie
from student.models import Registration, UserProfile, PendingNameChange, PendingEmailChange, CourseEnrollment
from util.cache import cache_if_anonymous
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore.django import modulestore
from django_future.csrf import ensure_csrf_cookie
from models import Registration, UserProfile, PendingNameChange, PendingEmailChange, CourseEnrollment
log = logging.getLogger("mitx.student")
......@@ -39,16 +40,15 @@ def csrf_token(context):
@ensure_csrf_cookie
@cache_if_anonymous
def index(request):
''' Redirects to main page -- info page if user authenticated, or marketing if not
'''
if settings.COURSEWARE_ENABLED and request.user.is_authenticated():
return redirect(reverse('dashboard'))
else:
csrf_token = csrf(request)['csrf_token']
# TODO: Clean up how 'error' is done.
return render_to_response('index.html', {'courses': modulestore().get_courses(),
'csrf': csrf_token})
return render_to_response('index.html', {'courses': modulestore().get_courses()})
@login_required
......@@ -494,28 +494,14 @@ def accept_name_change(request):
@ensure_csrf_cookie
@cache_if_anonymous
def course_info(request, course_id):
# This is the advertising page for a student to look at the course before signing up
csrf_token = csrf(request)['csrf_token']
course_loc = CourseDescriptor.id_to_location(course_id)
course = modulestore().get_item(course_loc)
# TODO: Couse should be a model
return render_to_response('portal/course_about.html', {'csrf': csrf_token, 'course': course})
def about(request):
return render_to_response('about.html', None)
def university_profile(request):
return render_to_response('university_profile.html', None)
def jobs(request):
return render_to_response('jobs.html', None)
def help(request):
return render_to_response('help.html', None)
return render_to_response('portal/course_about.html', {'course': course})
@login_required
......
......@@ -5,6 +5,8 @@ invalidation. Import these instead of django.core.cache.
Note that 'default' is being preserved for user session caching, which we're
not migrating so as not to inconvenience users by logging them all out.
"""
from functools import wraps
from django.core import cache
# If we can't find a 'general' CACHE defined in settings.py, we simply fall back
......@@ -14,3 +16,41 @@ try:
except Exception:
cache = cache.cache
def cache_if_anonymous(view_func):
"""
Many of the pages in edX are identical when the user is not logged
in, but should not be cached when the user is logged in (because
of the navigation bar at the top with the username).
The django middleware cache does not handle this correctly, because
we access the session to put the csrf token in the header. This adds
the cookie to the vary header, and so every page is cached seperately
for each user (because each user has a different csrf token).
Note that this decorator should only be used on views that do not
contain the csrftoken within the html. The csrf token can be included
in the header by ordering the decorators as such:
@ensure_csrftoken
@cache_if_anonymous
def myView(request):
"""
@wraps(view_func)
def _decorated(request, *args, **kwargs):
if not request.user.is_authenticated():
#Use the cache
cache_key = "cache_if_anonymous." + request.path
response = cache.get(cache_key)
if not response:
response = view_func(request, *args, **kwargs)
cache.set(cache_key, response, 60 * 3)
return response
else:
#Don't use the cache
return view_func(request, *args, **kwargs)
return _decorated
\ No newline at end of file
......@@ -19,7 +19,7 @@ from multicourse import multicourse_settings
from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor
from util.cache import cache
from util.cache import cache, cache_if_anonymous
from student.models import UserTestGroup
from courseware import grades
......@@ -51,11 +51,10 @@ def format_url_params(params):
@ensure_csrf_cookie
@cache_if_anonymous
def courses(request):
csrf_token = csrf(request)['csrf_token']
# TODO: Clean up how 'error' is done.
context = {'courses': modulestore().get_courses(),
'csrf': csrf_token}
context = {'courses': modulestore().get_courses()}
return render_to_response("courses.html", context)
......
......@@ -5,23 +5,12 @@
from mitxmako.shortcuts import render_to_response, render_to_string
from django.shortcuts import redirect
from django.core.context_processors import csrf
from django.conf import settings
from django_future.csrf import ensure_csrf_cookie
#valid_templates=['index.html', 'staff.html', 'info.html', 'credits.html']
valid_templates=['index.html',
'tos.html',
'privacy.html',
'honor.html',
'help.html',
'copyright.html',
'404.html',
'mitx_help.html',
'pressrelease.html',
'about.html',
'faq.html',
'press.html',
'contact.html']
from util.cache import cache_if_anonymous
valid_templates = []
if settings.STATIC_GRAB:
valid_templates = valid_templates+['server-down.html',
......@@ -33,15 +22,27 @@ if settings.STATIC_GRAB:
'6002x-press-release.html'
]
def index(request, template):
csrf_token = csrf(request)['csrf_token']
def index(request, template):
if template in valid_templates:
return render_to_response(template, {'error' : '',
'csrf': csrf_token })
return render_to_response('static_templates/' + template, {})
else:
return redirect('/')
valid_auth_templates=['help.html']
@ensure_csrf_cookie
@cache_if_anonymous
def render(request, template):
"""
This view function renders the template sent without checking that it
exists. Do not expose template as a regex part of the url. The user should
not be able to ender any arbitray template name. The correct usage would be:
url(r'^jobs$', 'static_template_view.views.render', {'template': 'jobs.html'}, name="jobs")
"""
return render_to_response('static_templates/' + template, {})
valid_auth_templates=[]
def auth_index(request, template):
if not request.user.is_authenticated():
......
......@@ -219,6 +219,7 @@ ASKBOT_ALLOWED_UPLOAD_FILE_TYPES = ('.jpg', '.jpeg', '.gif', '.bmp', '.png', '.t
ASKBOT_MAX_UPLOAD_FILE_SIZE = 1024 * 1024 # result in bytes
CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True
CACHE_PREFIX = SITE_ID
ASKBOT_URL = 'discussion/'
LOGIN_REDIRECT_URL = MITX_ROOT_URL + '/'
LOGIN_URL = MITX_ROOT_URL + '/'
......
......@@ -4,3 +4,4 @@
*.swp
*.orig
*.DS_Store
application.css
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<!-- TODO: Add pattern field to username. See HTML5 cookbook, page 84 for details-->
<div name="enroll_form" id="enroll_form">
<h1>Enroll in edx4edx</h1>
<!--[if lte IE 8]>
<p class="ie-warning"> Enrollment requires a modern web browser with JavaScript enabled. You don't have this. You can&rsquo;t enroll without upgrading, since you couldn&rsquo;t take the course without upgrading. Feel free to download the latest version of <a href="http://www.mozilla.org/en-US/firefox/new/">Mozilla Firefox</a> or <a href="http://support.google.com/chrome/bin/answer.py?hl=en&answer=95346">Google Chrome</a>, for free, to enroll and take this course.</p>
<![endif]-->
<p class="disclaimer">
</p>
<form name="enroll" id="enroll_form" method="get">
<fieldset><% if 'error' in locals(): e = error %>
<div id="enroll_error" name="enroll_error"></div>
<ol>
<li class="email">
<label>E-mail*</label>
<input name="email" id="ca_email" type="email" />
</li>
<li class="password">
<label>Password*</label>
<input name="password" id="ca_password" type="password" />
</li>
<li class="username">
<label>Username (public)* <span class="ui-icon ui-icon-help" id="spinner_nick" style="display:inline-block;"></span></label>
<input name="username" id="ca_username" type="text" />
<div id="sregion_nick" class="tip">Nickname you'd like to use on forums.</div>
</li>
<li class="full-name">
<label>Full name*<span class="ui-icon ui-icon-help" id="spinner_name" style="display:inline-block;"></span></label>
<input name="name" id="ca_name" type="text" />
<div class="tip" id="sregion_name">If you successfully complete the course, you will receive an electronic certificate of accomplishment from <i>edX</i> with this name on it.</div>
</li>
<li class="location">
<label>Location <span class="ui-icon ui-icon-help" id="spinner_location" style="display:inline-block;"></span></label>
<input name="location" id="ca_location" type="text" />
<div id="sregion_location" class="tip">Preferred format is city, state, country (so for us, &quot;Cambridge, Massachusetts, USA&quot;).</div>
</li>
<li class="language">
<label>Preferred Language <span class="ui-icon ui-icon-help" id="spinner_language" style="display:inline-block;"></span></label>
<input name="language" id="ca_language" type="text" />
<div id="sregion_language" class="tip">Please let us know what language you'd most like to see the content in (even if not your native). We're working on translations and internationalization.</div>
</li>
<li class="terms">
<label> <input name="terms_of_service" id="cb_terms_of_service" type="checkbox" value="terms_of_service" />I agree to the <a href="/t/tos.html">Terms of Service</a>*</label>
</li>
<li class="honor-code">
<label>
<input name="honor_code" id="cb_honor_code" type="checkbox" value="honor_code" />I agree to the <a href="/t/honor.html">Honor Code</a>, summarized as:*</label>
<ul>
<li>Complete all mid-terms and final exams with only my own work.</li>
<li>Maintain only one account, and not share the username or password.</li>
<li>Not engage in any activities that would dishonestly improve my results, or improve or hurt those of others.</li>
<li>Not post answers to problems that are being used to assess student performance.</li>
</ul>
</li>
</ol>
<input name="create_account_button" id="create_account_button" type="submit" value="Create Account">
</fieldset> </form>
</div>
<%! from django.core.urlresolvers import reverse %>
This is to confirm that you changed the e-mail associated with MITx
from ${old_email} to ${new_email}. If you did not make this request,
please contact the course staff immediately. Contact information is
listed at:
% if is_secure:
https://${ site }/t/mitx_help.html
https://${ site }${reverse('contact')}
% else:
http://${ site }/t/mitx_help.html
http://${ site }${reverse('contact')}
% endif
We keep a log of old e-mails, so if this request was unintentional, we
......
......@@ -7,10 +7,10 @@
<section class="primary">
<a href="${reverse('root')}" class="logo"></a>
<a href="${reverse('courses')}">Find Courses</a>
<a href="/t/about.html">About</a>
<a href="${reverse('about_edx')}">About</a>
<a href="#">Blog</a>
<a href="/t/jobs.html">Jobs</a>
<a href="/t/contact.html">Contact</a>
<a href="${reverse('jobs')}">Jobs</a>
<a href="${reverse('contact')}">Contact</a>
</section>
<section class="social">
......@@ -22,14 +22,14 @@
<section class="bottom">
<section class="copyright">
<p>&copy; 2012 edX, <a href="/t/copyright.html">some rights reserved.</a></p>
<p>&copy; 2012 edX, <a href="${reverse('copyright')}">some rights reserved.</a></p>
</section>
<section class="secondary">
<a href="/t/tos.html">Terms of Service</a>
<a href="/t/privacy.html">Privacy Policy</a>
<a href="/t/honor.html">Honor Code</a>
<a href="/t/help.html">Help</a>
<a href="${reverse('tos')}">Terms of Service</a>
<a href="${reverse('privacy_edx')}">Privacy Policy</a>
<a href="${reverse('honor')}">Honor Code</a>
<a href="${reverse('help_edx')}">Help</a>
</section>
</section>
......
......@@ -87,7 +87,7 @@
<section class="more-info">
<header>
<h2>edX News & Announcements</h2>
<a href="/t/press.html">Read More &rarr;</a>
<a href="${reverse('press')}">Read More &rarr;</a>
</header>
<section class="news">
<section class="blog-posts">
......
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='static_content.html'/>
<!DOCTYPE html>
<html>
......@@ -84,13 +85,13 @@ function postJSON(url, data, callback) {
<footer>
<div class="footer-wrapper">
<p> Copyright &copy; 2012. MIT. <a href="/t/copyright.html">Some rights reserved.</a></p>
<p> Copyright &copy; 2012. MIT. <a href="${reverse('copyright')}">Some rights reserved.</a></p>
<ul>
<li><a href="/t/tos.html">Terms of Service</a></li>
<li><a href="/t/privacy.html">Privacy Policy</a></li>
<li><a href="/t/honor.html">Honor Code</a></li>
<li><a href="/t/mitx_help.html">Help</a></li>
<li><a href="${reverse('tos')}">Terms of Service</a></li>
<li><a href="${reverse('privacy')}">Privacy Policy</a></li>
<li><a href="${reverse('honor')}">Honor Code</a></li>
<li><a href="${reverse('help_edx')}">Help</a></li>
</ul>
<ul aria-label="Social Links" class="social">
......
<%inherit file="marketing.html" />
<section class="tos">
<div>
<section class="help-email">
<h2>Help &amp; Feedback</h2>
<p> If run into problems signing up for the web site which you
cannot resolve on your own, please check
the <a href="http://mitx.mit.edu/6002x-faq.html">Frequently
Asked Questions</a>. If you find a bug or other issues, you can
reach us at:</p>
<dl>
<dt>System-related questions</dt>
<dd><a href="mailto:technical@mitx.mit.edu">technical@mitx.mit.edu</a> -- For technical questions, please make sure you are using a current version of <a href="http://www.mozilla.org/en-US/firefox/new/">Firefox</a> or <a href="https://www.google.com/chrome/">Chrome</a>, and include browser and version in your e-mail, as well as screenshots or other pertinent details. </dd>
<dt>Content-related questions</dt>
<dd><a href="mailto:content@mitx.mit.edu">content@mitx.mit.edu</a></dd>
<dt>Bug reports</dt>
<dd><a href="mailto:bugs@mitx.mit.edu">bugs@mitx.mit.edu</a></dd>
<dt>Suggestions</dt>
<dd><a href="mailto:suggestions@mitx.mit.edu">suggestions@mitx.mit.edu</a></dd>
</dl>
<p> Please bear in mind that while we read them, we do not expect to
have time to respond to all e-mails.</p>
</section>
</div>
</section>
......@@ -34,7 +34,7 @@
%else:
<ol class="guest">
<li class="secondary">
<a href="/t/about.html">About</a>
<a href="${reverse('about_edx')}">About</a>
<a href="#">Blog</a>
<a href="${reverse('jobs')}">Jobs</a>
<a href="/t/contact.html">Contact</a>
......
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<section id="signup-modal" class="modal signup-modal">
<div class="inner-wrapper">
......@@ -25,12 +26,12 @@
<label class="terms-of-service">
<input name="terms_of_service" type="checkbox" value="true">
I agree to the
<a href="#">Terms of Service</a>
<a href="${reverse('tos')}">Terms of Service</a>
</label>
<label class="honor-code">
<input name="honor_code" type="checkbox" value="true">
I agree to the
<a href="/t/honor.html" target="blank">Honor Code</a>
<a href="${reverse('honor')}" target="blank">Honor Code</a>
</label>
<!--
......
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="outside-app">
<h1>Page not found</h1>
......
<%inherit file="marketing.html" />
<%inherit file="../marketing.html" />
<%block name="login_area">
</%block>
......
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='../static_content.html'/>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="container about">
<nav>
<a href="/t/about.html" class="active" >Vision</a>
<a href="/t/faq.html">Faq</a>
<a href="/t/press.html">Press</a>
<a href="/t/contact.html">Contact</a>
<a href="${reverse('about_edx')}" class="active">Vision</a>
<a href="${reverse('faq_edx')}">Faq</a>
<a href="${reverse('press')}">Press</a>
<a href="${reverse('contact')}">Contact</a>
</nav>
<section class="vision">
......
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='../static_content.html'/>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="container about">
<nav>
<a href="/t/about.html">Vision</a>
<a href="/t/faq.html">Faq</a>
<a href="/t/press.html">Press</a>
<a href="/t/contact.html" class="active">Contact</a>
<a href="${reverse('about_edx')}">Vision</a>
<a href="${reverse('faq_edx')}">Faq</a>
<a href="${reverse('press')}">Press</a>
<a href="${reverse('contact')}" class="active">Contact</a>
</nav>
<section class="contact">
......
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="static-container copyright">
<h1> Licensing Information </h1>
......
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='../static_content.html'/>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="container about">
<nav>
<a href="/t/about.html">Vision</a>
<a href="/t/faq.html" class="active">Faq</a>
<a href="/t/press.html">Press</a>
<a href="/t/contact.html">Contact</a>
<a href="${reverse('about_edx')}">Vision</a>
<a href="${reverse('faq_edx')}" class="active">Faq</a>
<a href="${reverse('press')}">Press</a>
<a href="${reverse('contact')}">Contact</a>
</nav>
<section class="faq">
......
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<%block name="title"><title>Help - MITx 6.002x</title></%block>
......@@ -13,7 +13,7 @@
<h2>Self-help</h2>
<ul>
<li><p>Read the <a href="/t/faq.html">FAQ</a> carefully</p></li>
<li><p>Read the <a href="${reverse('faq_edx')}">FAQ</a> carefully</p></li>
<li><p>Check the <a href="/info">course updates</a> -- we will announce major errors and issues there </p></li>
<li><p>Check whether the issues has been asked on the <a href="/discussion">discussion forums</a>, and if not, ask</p></li>
<li><p>Ask in the IRC channel (irc.mitx.mit.edu, channel #6002)]</p></li>
......
<%inherit file="../main.html" />
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="static-container honor-code">
<h1> Collaboration Policy </h1>
......
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="container jobs">
<h1>Want to change the future of education?</h1>
......
<%namespace name='static' file='static_content.html'/>
<%! from django.core.urlresolvers import reverse %>
<%namespace name='static' file='../static_content.html'/>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="container about">
<nav>
<a href="/t/about.html">Vision</a>
<a href="/t/faq.html">Faq</a>
<a href="/t/press.html" class="active">Press</a>
<a href="/t/contact.html">Contact</a>
<a href="${reverse('about_edx')}">Vision</a>
<a href="${reverse('faq_edx')}">Faq</a>
<a href="${reverse('press')}" class="active">Press</a>
<a href="${reverse('contact')}">Contact</a>
</nav>
<section class="press">
<section class="press-resources">
<section class="pressreleases">
<p>View our <a href="/t/pressrelease.html">Press Release</a></p>
<p>View our <a href="${reverse('pressrelease')}">Press Release</a></p>
</section>
<section class="identity-assets">
<p>Download our <a href="/t/pressrelease.html">Logos</a></p>
<p>Download our <a href="${reverse('pressrelease')}">Logos</a></p>
</section>
</section>
<article class="press-story">
......
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="pressrelease">
<section class="container">
......
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="static-container privacy-policy">
<h1>Privacy Policy</h1>
......
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="outside-app">
<h1>Currently the <em>edX</em> servers are down</h1>
......
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="outside-app">
<h1>There has been an error on the <em>edX</em> servers</h1>
......
<%inherit file="main.html" />
<%inherit file="../main.html" />
<section class="outside-app">
<h1>Currently the <em>MITx</em> servers are overloaded</h1>
......
<%! from django.core.urlresolvers import reverse %>
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="static-container tos">
<h1>MITx Terms of Service</h1>
......@@ -9,8 +9,8 @@
<div class="inner-wrapper">
<p>Welcome to <i>MITx</i>. You must read and agree to these Terms of Service
(&quot;TOS&quot;), <i>MITx</i>&rsquo;s <a href="/t/privacy.html">Privacy
Policy</a>, and <a href="/t/honor.html">Honor Code</a> prior to
(&quot;TOS&quot;), <i>MITx</i>&rsquo;s <a href="${reverse('privacy_edx')}">Privacy
Policy</a>, and <a href="${reverse('honor')}">Honor Code</a> prior to
registering for this site or using any portion of this site
(&ldquo;Site&rdquo;), including accessing any course materials, chat
room, mailing list, or other electronic service. These TOS, the
......@@ -44,7 +44,7 @@
or other users of the Site, including but not limited to all forum
posts, wiki edits, notes, questions, comments, videos, and file
uploads. You agree that you will use the Site in compliance with these
TOS, the <a href="/t/honor.html">Honor Code</a>, and all applicable
TOS, the <a href="${reverse('honor')}">Honor Code</a>, and all applicable
local, state, national, and international laws, rules and regulations,
including copyright laws and any laws regarding the transmission of
technical data exported from your country of residence and all United
......@@ -110,7 +110,7 @@
information to keep it accurate and current. </p>
<p>We care about the confidentiality and security of your personal
information. Please see our <a href="/t/privacy.html">Privacy
information. Please see our <a href="${reverse('privacy_edx')}">Privacy
Policy</a> for more information about what information about
you <i>MITx</i> collects and how <i>MITx</i> uses that
information.</p>
......@@ -133,7 +133,7 @@
this Site you agree to abide by all such rules and conditions. Due to
privacy concerns, User Postings shall be licensed to <i>MITx</i> with
the terms discussed below. Please
see <a href="/t/copyright.html"><i>MITx's Copyright Page</i></a> for
see <a href="${reverse('copyright')}"><i>MITx's Copyright Page</i></a> for
more information.</p>
<h2>User Postings</h2>
......
<%inherit file="main.html" />
<%inherit file="../main.html" />
<%namespace name='static' file='static_content.html'/>
<%namespace name='static' file='../static_content.html'/>
<section class="university-profile">
<header class="search" style="background: url('/static/images/shot-5-large.jpg')">
......
......@@ -12,10 +12,6 @@ if settings.DEBUG:
urlpatterns = ('',
url(r'^$', 'student.views.index', name="root"), # Main marketing page, or redirect to courseware
url(r'^about$', 'student.views.about', name="about_edx"),
url(r'^university_profile$', 'student.views.university_profile', name="university_profile"),
url(r'^jobs$', 'student.views.jobs', name="jobs"),
url(r'^help$', 'student.views.help', name="help_edx"),
url(r'^dashboard$', 'student.views.dashboard', name="dashboard"),
url(r'^change_email$', 'student.views.change_email_request'),
url(r'^email_confirm/(?P<key>[^/]*)$', 'student.views.confirm_email_change'),
......@@ -48,6 +44,47 @@ urlpatterns = ('',
name='auth_password_reset_done'),
## Feedback
url(r'^send_feedback$', 'util.views.send_feedback'),
#Semi-static views (these need to be rendered and have the login bar, but don't change)
url(r'^404$', 'static_template_view.views.render',
{'template': '404.html'}, name="404"),
url(r'^about$', 'static_template_view.views.render',
{'template': 'about.html'}, name="about_edx"),
url(r'^jobs$', 'static_template_view.views.render',
{'template': 'jobs.html'}, name="jobs"),
url(r'^contact$', 'static_template_view.views.render',
{'template': 'contact.html'}, name="contact"),
url(r'^press$', 'static_template_view.views.render',
{'template': 'press.html'}, name="press"),
url(r'^faq$', 'static_template_view.views.render',
{'template': 'faq.html'}, name="faq_edx"),
url(r'^help$', 'static_template_view.views.render',
{'template': 'help.html'}, name="help_edx"),
url(r'^pressrelease$', 'static_template_view.views.render',
{'template': 'pressrelease.html'}, name="pressrelease"),
url(r'^tos$', 'static_template_view.views.render',
{'template': 'tos.html'}, name="tos"),
url(r'^privacy$', 'static_template_view.views.render',
{'template': 'privacy.html'}, name="privacy_edx"),
url(r'^copyright$', 'static_template_view.views.render',
{'template': 'copyright.html'}, name="copyright"),
url(r'^honor$', 'static_template_view.views.render',
{'template': 'honor.html'}, name="honor"),
#Temporarily static, for testing
url(r'^university_profile$', 'static_template_view.views.render',
{'template': 'university_profile.html'}, name="university_profile"),
#TODO: Convert these pages to the new edX layout
# 'tos.html',
# 'privacy.html',
# 'honor.html',
# 'copyright.html',
)
if settings.PERFSTATS:
......
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