Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cms/djangoapps/contentstore/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
from .user import *
from .tabs import *
from .requests import *
try:
from .dev import *
except ImportError:
pass
12 changes: 12 additions & 0 deletions cms/djangoapps/contentstore/views/dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Views that are only activated when the project is running in development mode.
These views will NOT be shown on production: trying to access them will result
in a 404 error.
"""
# pylint: disable=W0613
from mitxmako.shortcuts import render_to_response

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



def dev_mode(request):
"Sample static view"
return render_to_response("dev/dev_mode.html")
4 changes: 4 additions & 0 deletions cms/templates/dev/dev_mode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%inherit file="../base.html" />
<%block name="content">
You're in dev mode!
</%block>
11 changes: 8 additions & 3 deletions cms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@


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 += (
Expand All @@ -154,6 +152,13 @@
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
Expand Down
10 changes: 10 additions & 0 deletions cms/urls_dev.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
URLconf for development-only views.
This gets imported by urls.py and added to its URLconf if we are running in
development mode; otherwise, it is ignored.
"""
from django.conf.urls import url

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing docstring.


urlpatterns = (
url(r'^dev_mode$', 'contentstore.views.dev.dev_mode', name='dev_mode'),
)