Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
e7028c6e
Commit
e7028c6e
authored
Oct 06, 2016
by
Robert Raposa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move static_template_view.views to its own urls.py.
parent
cd869d29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
69 deletions
+59
-69
lms/djangoapps/static_template_view/urls.py
+57
-0
lms/urls.py
+2
-69
No files found.
lms/djangoapps/static_template_view/urls.py
0 → 100644
View file @
e7028c6e
"""
URLs for static_template_view app
"""
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
url
urlpatterns
=
(
'static_template_view.views'
,
# TODO: Is this used anymore? What is STATIC_GRAB?
url
(
r'^t/(?P<template>[^/]*)$'
,
'index'
),
# Semi-static views (these need to be rendered and have the login bar, but don't change)
url
(
r'^404$'
,
'render'
,
{
'template'
:
'404.html'
},
name
=
"404"
),
# display error page templates, for testing purposes
url
(
r'^404$'
,
'render_404'
),
# Can this be deleted? Test test_404_microsites fails with this.
url
(
r'^500$'
,
'render_500'
),
url
(
r'^blog$'
,
'render'
,
{
'template'
:
'blog.html'
},
name
=
"blog"
),
url
(
r'^contact$'
,
'render'
,
{
'template'
:
'contact.html'
},
name
=
"contact"
),
url
(
r'^donate$'
,
'render'
,
{
'template'
:
'donate.html'
},
name
=
"donate"
),
url
(
r'^faq$'
,
'render'
,
{
'template'
:
'faq.html'
},
name
=
"faq"
),
url
(
r'^help$'
,
'render'
,
{
'template'
:
'help.html'
},
name
=
"help_edx"
),
url
(
r'^jobs$'
,
'render'
,
{
'template'
:
'jobs.html'
},
name
=
"jobs"
),
url
(
r'^news$'
,
'render'
,
{
'template'
:
'news.html'
},
name
=
"news"
),
url
(
r'^press$'
,
'render'
,
{
'template'
:
'press.html'
},
name
=
"press"
),
url
(
r'^media-kit$'
,
'render'
,
{
'template'
:
'media-kit.html'
},
name
=
"media-kit"
),
url
(
r'^copyright$'
,
'render'
,
{
'template'
:
'copyright.html'
},
name
=
"copyright"
),
# Press releases
url
(
r'^press/([_a-zA-Z0-9-]+)$'
,
'render_press_release'
,
name
=
'press_release'
),
)
# Only enable URLs for those marketing links actually enabled in the
# settings. Disable URLs by marking them as None.
for
key
,
value
in
settings
.
MKTG_URL_LINK_MAP
.
items
():
# Skip disabled URLs
if
value
is
None
:
continue
# These urls are enabled separately
if
key
==
"ROOT"
or
key
==
"COURSES"
:
continue
# The MKTG_URL_LINK_MAP key specifies the template filename
template
=
key
.
lower
()
if
'.'
not
in
template
:
# Append STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION if
# no file extension was specified in the key
template
=
"
%
s.
%
s"
%
(
template
,
settings
.
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION
)
# Make the assumption that the URL we want is the lowercased
# version of the map key
urlpatterns
+=
(
url
(
r'^
%
s$'
%
key
.
lower
(),
'render'
,
{
'template'
:
template
},
name
=
value
),)
urlpatterns
=
patterns
(
*
urlpatterns
)
lms/urls.py
View file @
e7028c6e
...
...
@@ -38,8 +38,8 @@ urlpatterns = (
# Performance endpoints
url
(
r''
,
include
(
'openedx.core.djangoapps.performance.urls'
)),
#
TODO: Is this used anymore? What is STATIC_GRAB?
url
(
r'
^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
#
Static template view endpoints like blog, faq, etc.
url
(
r'
'
,
include
(
'static_template_view.urls'
)
),
url
(
r'^heartbeat$'
,
include
(
'openedx.core.djangoapps.heartbeat.urls'
)),
...
...
@@ -144,12 +144,6 @@ urlpatterns += (
url
(
r'^support/'
,
include
(
'support.urls'
,
app_name
=
"support"
,
namespace
=
'support'
)),
)
# Semi-static views (these need to be rendered and have the login bar, but don't change)
urlpatterns
+=
(
url
(
r'^404$'
,
'static_template_view.views.render'
,
{
'template'
:
'404.html'
},
name
=
"404"
),
)
# Favicon
favicon_path
=
configuration_helpers
.
get_value
(
'favicon_path'
,
settings
.
FAVICON_PATH
)
# pylint: disable=invalid-name
urlpatterns
+=
(
url
(
...
...
@@ -157,57 +151,6 @@ urlpatterns += (url(
RedirectView
.
as_view
(
url
=
settings
.
STATIC_URL
+
favicon_path
,
permanent
=
True
)
),)
urlpatterns
+=
(
url
(
r'^blog$'
,
'static_template_view.views.render'
,
{
'template'
:
'blog.html'
},
name
=
"blog"
),
url
(
r'^contact$'
,
'static_template_view.views.render'
,
{
'template'
:
'contact.html'
},
name
=
"contact"
),
url
(
r'^donate$'
,
'static_template_view.views.render'
,
{
'template'
:
'donate.html'
},
name
=
"donate"
),
url
(
r'^faq$'
,
'static_template_view.views.render'
,
{
'template'
:
'faq.html'
},
name
=
"faq"
),
url
(
r'^help$'
,
'static_template_view.views.render'
,
{
'template'
:
'help.html'
},
name
=
"help_edx"
),
url
(
r'^jobs$'
,
'static_template_view.views.render'
,
{
'template'
:
'jobs.html'
},
name
=
"jobs"
),
url
(
r'^news$'
,
'static_template_view.views.render'
,
{
'template'
:
'news.html'
},
name
=
"news"
),
url
(
r'^press$'
,
'static_template_view.views.render'
,
{
'template'
:
'press.html'
},
name
=
"press"
),
url
(
r'^media-kit$'
,
'static_template_view.views.render'
,
{
'template'
:
'media-kit.html'
},
name
=
"media-kit"
),
url
(
r'^copyright$'
,
'static_template_view.views.render'
,
{
'template'
:
'copyright.html'
},
name
=
"copyright"
),
# Press releases
url
(
r'^press/([_a-zA-Z0-9-]+)$'
,
'static_template_view.views.render_press_release'
,
name
=
'press_release'
),
)
# Only enable URLs for those marketing links actually enabled in the
# settings. Disable URLs by marking them as None.
for
key
,
value
in
settings
.
MKTG_URL_LINK_MAP
.
items
():
# Skip disabled URLs
if
value
is
None
:
continue
# These urls are enabled separately
if
key
==
"ROOT"
or
key
==
"COURSES"
:
continue
# The MKTG_URL_LINK_MAP key specifies the template filename
template
=
key
.
lower
()
if
'.'
not
in
template
:
# Append STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION if
# no file extension was specified in the key
template
=
"
%
s.
%
s"
%
(
template
,
settings
.
STATIC_TEMPLATE_VIEW_DEFAULT_FILE_EXTENSION
)
# Make the assumption that the URL we want is the lowercased
# version of the map key
urlpatterns
+=
(
url
(
r'^
%
s$'
%
key
.
lower
(),
'static_template_view.views.render'
,
{
'template'
:
template
},
name
=
value
),)
# Multicourse wiki (Note: wiki urls must be above the courseware ones because of
# the custom tab catch-all)
if
settings
.
WIKI_ENABLED
:
...
...
@@ -976,16 +919,6 @@ if 'debug_toolbar' in settings.INSTALLED_APPS:
url
(
r'^__debug__/'
,
include
(
debug_toolbar
.
urls
)),
)
# Custom error pages
handler404
=
'static_template_view.views.render_404'
handler500
=
'static_template_view.views.render_500'
# display error page templates, for testing purposes
urlpatterns
+=
(
url
(
r'^404$'
,
handler404
),
url
(
r'^500$'
,
handler500
),
)
# include into our URL patterns the HTTP REST API that comes with edx-proctoring.
urlpatterns
+=
(
url
(
r'^api/'
,
include
(
'edx_proctoring.urls'
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment