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
ddc46833
Commit
ddc46833
authored
Oct 14, 2015
by
Giovanni Di Milia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed pylint violation for files in lms/
parent
2b5810db
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
17 deletions
+68
-17
lms/tests.py
+2
-2
lms/urls.py
+47
-13
lms/wsgi.py
+11
-1
lms/wsgi_apache_lms.py
+8
-1
No files found.
lms/tests.py
View file @
ddc46833
...
...
@@ -34,12 +34,12 @@ class TemplateLookupTests(TestCase):
add_lookup
(
'main'
,
'external_module'
,
__name__
)
directories
=
LOOKUP
[
'main'
]
.
directories
self
.
assertEqual
(
len
([
dir
for
dir
in
directories
if
'external_module'
in
dir
]),
1
)
self
.
assertEqual
(
len
([
dir
ectory
for
directory
in
directories
if
'external_module'
in
directory
]),
1
)
# This should not clear the directories list
startup
.
enable_microsites
()
directories
=
LOOKUP
[
'main'
]
.
directories
self
.
assertEqual
(
len
([
dir
for
dir
in
directories
if
'external_module'
in
dir
]),
1
)
self
.
assertEqual
(
len
([
dir
ectory
for
directory
in
directories
if
'external_module'
in
directory
]),
1
)
@patch.dict
(
'django.conf.settings.FEATURES'
,
{
'ENABLE_FEEDBACK_SUBMISSION'
:
True
})
...
...
lms/urls.py
View file @
ddc46833
"""
URLs for LMS
"""
from
django.conf
import
settings
from
django.conf.urls
import
patterns
,
include
,
url
from
ratelimitbackend
import
admin
...
...
@@ -27,7 +31,9 @@ urlpatterns = (
url
(
r'^event$'
,
'track.views.user_track'
),
url
(
r'^performance$'
,
'performance.views.performance_log'
),
url
(
r'^segmentio/event$'
,
'track.views.segmentio.segmentio_event'
),
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
# TODO: Is this used anymore? What is STATIC_GRAB?
# TODO: Is this used anymore? What is STATIC_GRAB?
url
(
r'^t/(?P<template>[^/]*)$'
,
'static_template_view.views.index'
),
url
(
r'^accounts/manage_user_standing'
,
'student.views.manage_user_standing'
,
name
=
'manage_user_standing'
),
...
...
@@ -313,15 +319,20 @@ if settings.COURSEWARE_ENABLED:
# into the database.
url
(
r'^software-licenses$'
,
'licenses.views.user_software_license'
,
name
=
"user_software_license"
),
url
(
r'^courses/{}/xqueue/(?P<userid>[^/]*)/(?P<mod_id>.*?)/(?P<dispatch>[^/]*)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
url
(
r'^courses/{}/xqueue/(?P<userid>[^/]*)/(?P<mod_id>.*?)/(?P<dispatch>[^/]*)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.module_render.xqueue_callback'
,
name
=
'xqueue_callback'
),
name
=
'xqueue_callback'
),
url
(
r'^change_setting$'
,
'student.views.change_setting'
,
name
=
'change_setting'
),
# TODO: These views need to be updated before they work
url
(
r'^calculate$'
,
'util.views.calculate'
),
# TODO: We should probably remove the circuit package. I believe it was only used in the old way of saving wiki circuits for the wiki
# TODO: We should probably remove the circuit package. I believe it was only used in the old way of saving wiki
# circuits for the wiki
# url(r'^edit_circuit/(?P<circuit>[^/]*)$', 'circuit.views.edit_circuit'),
# url(r'^save_circuit/(?P<circuit>[^/]*)$', 'circuit.views.save_circuit'),
...
...
@@ -339,8 +350,9 @@ if settings.COURSEWARE_ENABLED:
'courseware.views.course_info'
,
name
=
"course_root"
),
url
(
r'^courses/{}/info$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.course_info'
,
name
=
"info"
),
# TODO arjun remove when custom tabs in place, see courseware/courses.py
url
(
r'^courses/{}/syllabus$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.syllabus'
,
name
=
"syllabus"
),
# TODO arjun remove when custom tabs in place, see courseware/courses.py
'courseware.views.syllabus'
,
name
=
"syllabus"
),
#Survey associated with a course
url
(
r'^courses/{}/survey$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
...
...
@@ -358,8 +370,12 @@ if settings.COURSEWARE_ENABLED:
url
(
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'staticbook.views.pdf_index'
,
name
=
"pdf_book"
),
url
(
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/(?P<page>\d+)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'staticbook.views.pdf_index'
,
name
=
"pdf_book"
),
url
(
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/(?P<page>\d+)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'staticbook.views.pdf_index'
,
name
=
"pdf_book"
),
url
(
r'^courses/{}/htmlbook/(?P<book_index>\d+)/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'staticbook.views.html_index'
,
name
=
"html_book"
),
...
...
@@ -372,8 +388,12 @@ if settings.COURSEWARE_ENABLED:
'courseware.views.index'
,
name
=
"courseware_chapter"
),
url
(
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.index'
,
name
=
"courseware_section"
),
url
(
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.index'
,
name
=
"courseware_position"
),
url
(
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.index'
,
name
=
"courseware_position"
),
url
(
r'^courses/{}/progress$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.progress'
,
name
=
"progress"
),
...
...
@@ -512,7 +532,10 @@ if settings.COURSEWARE_ENABLED:
if
settings
.
FEATURES
.
get
(
'ENABLE_STUDENT_HISTORY_VIEW'
):
urlpatterns
+=
(
url
(
r'^courses/{}/submission_history/(?P<student_username>[^/]*)/(?P<location>.*?)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
url
(
r'^courses/{}/submission_history/(?P<student_username>[^/]*)/(?P<location>.*?)$'
.
format
(
settings
.
COURSE_ID_PATTERN
),
'courseware.views.submission_history'
,
name
=
'submission_history'
),
)
...
...
@@ -580,7 +603,11 @@ urlpatterns += (
if
settings
.
FEATURES
.
get
(
'AUTH_USE_OPENID_PROVIDER'
):
urlpatterns
+=
(
url
(
r'^openid/provider/login/$'
,
'external_auth.views.provider_login'
,
name
=
'openid-provider-login'
),
url
(
r'^openid/provider/login/(?:.+)$'
,
'external_auth.views.provider_identity'
,
name
=
'openid-provider-login-identity'
),
url
(
r'^openid/provider/login/(?:.+)$'
,
'external_auth.views.provider_identity'
,
name
=
'openid-provider-login-identity'
),
url
(
r'^openid/provider/identity/$'
,
'external_auth.views.provider_identity'
,
name
=
'openid-provider-identity'
),
url
(
r'^openid/provider/xrds/$'
,
'external_auth.views.provider_xrds'
,
name
=
'openid-provider-xrds'
)
)
...
...
@@ -595,7 +622,10 @@ if settings.FEATURES.get('ENABLE_LMS_MIGRATION'):
urlpatterns
+=
(
url
(
r'^migrate/modules$'
,
'lms_migration.migrate.manage_modulestores'
),
url
(
r'^migrate/reload/(?P<reload_dir>[^/]+)$'
,
'lms_migration.migrate.manage_modulestores'
),
url
(
r'^migrate/reload/(?P<reload_dir>[^/]+)/(?P<commit_id>[^/]+)$'
,
'lms_migration.migrate.manage_modulestores'
),
url
(
r'^migrate/reload/(?P<reload_dir>[^/]+)/(?P<commit_id>[^/]+)$'
,
'lms_migration.migrate.manage_modulestores'
),
url
(
r'^gitreload$'
,
'lms_migration.migrate.gitreload'
),
url
(
r'^gitreload/(?P<reload_dir>[^/]+)$'
,
'lms_migration.migrate.gitreload'
),
)
...
...
@@ -613,7 +643,11 @@ if settings.FEATURES.get('ENABLE_SERVICE_STATUS'):
if
settings
.
FEATURES
.
get
(
'ENABLE_INSTRUCTOR_BACKGROUND_TASKS'
):
urlpatterns
+=
(
url
(
r'^instructor_task_status/$'
,
'instructor_task.views.instructor_task_status'
,
name
=
'instructor_task_status'
),
url
(
r'^instructor_task_status/$'
,
'instructor_task.views.instructor_task_status'
,
name
=
'instructor_task_status'
),
)
if
settings
.
FEATURES
.
get
(
'RUN_AS_ANALYTICS_SERVER_ENABLED'
):
...
...
lms/wsgi.py
View file @
ddc46833
"""
WSGI config for LMS.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments.
It exposes a module-level variable named ``application``. Django's
``runserver`` and ``runfcgi`` commands discover this application via the
``WSGI_APPLICATION`` setting.
"""
# Patch the xml libs
from
safe_lxml
import
defuse_xml_libs
defuse_xml_libs
()
...
...
@@ -25,4 +35,4 @@ modulestore()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
application
=
get_wsgi_application
()
# pylint: disable=invalid-name
lms/wsgi_apache_lms.py
View file @
ddc46833
"""
Apache WSGI file for LMS
This module contains the WSGI application used for Apache deployment.
It exposes a module-level variable named ``application``.
"""
# Patch the xml libs before anything else.
from
safe_lxml
import
defuse_xml_libs
defuse_xml_libs
()
...
...
@@ -13,4 +20,4 @@ startup.run()
# This application object is used by the development server
# as well as any WSGI server configured to use this file.
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
application
=
get_wsgi_application
()
# pylint: disable=invalid-name
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