Create urls/views/templates for dev-only views
Our designers find it helpful to be able to stub out simple views that aren't ready to be seen for production yet, and check them into version control so that other people can see them and provide feedback. This commit introduces a few new files and directories for this purpose, as well as a sample view that will only be seen in dev mode, and never in production.
This commit is contained in:
@@ -15,3 +15,7 @@ from .public import *
|
||||
from .user import *
|
||||
from .tabs import *
|
||||
from .requests import *
|
||||
try:
|
||||
from .dev import *
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
5
cms/djangoapps/contentstore/views/dev.py
Normal file
5
cms/djangoapps/contentstore/views/dev.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from mitxmako.shortcuts import render_to_response
|
||||
|
||||
|
||||
def dev_mode(request):
|
||||
return render_to_response("dev/dev_mode.html")
|
||||
4
cms/templates/dev/dev_mode.html
Normal file
4
cms/templates/dev/dev_mode.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<%inherit file="../base.html" />
|
||||
<%block name="content">
|
||||
You're in dev mode!
|
||||
</%block>
|
||||
11
cms/urls.py
11
cms/urls.py
@@ -137,9 +137,7 @@ urlpatterns += (
|
||||
|
||||
|
||||
if settings.ENABLE_JASMINE:
|
||||
# # Jasmine
|
||||
urlpatterns = urlpatterns + (url(r'^_jasmine/', include('django_jasmine.urls')),)
|
||||
|
||||
urlpatterns += (url(r'^_jasmine/', include('django_jasmine.urls')),)
|
||||
|
||||
if settings.MITX_FEATURES.get('ENABLE_SERVICE_STATUS'):
|
||||
urlpatterns += (
|
||||
@@ -154,6 +152,13 @@ if settings.MITX_FEATURES.get('AUTOMATIC_AUTH_FOR_LOAD_TESTING'):
|
||||
url(r'^auto_auth$', 'student.views.auto_auth'),
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
try:
|
||||
from .urls_dev import urlpatterns as dev_urlpatterns
|
||||
urlpatterns += dev_urlpatterns
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
urlpatterns = patterns(*urlpatterns)
|
||||
|
||||
# Custom error pages
|
||||
|
||||
5
cms/urls_dev.py
Normal file
5
cms/urls_dev.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.conf.urls import url
|
||||
|
||||
urlpatterns = (
|
||||
url(r'^dev_mode$', 'contentstore.views.dev.dev_mode', name='dev_mode'),
|
||||
)
|
||||
Reference in New Issue
Block a user