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
21791ccb
Commit
21791ccb
authored
Sep 25, 2017
by
bmedx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change Django settings from tuples to lists to prep for 1.11 upgrade
parent
1dc9b119
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
125 additions
and
124 deletions
+125
-124
cms/envs/acceptance.py
+3
-3
cms/envs/aws.py
+7
-5
cms/envs/bok_choy.py
+2
-2
cms/envs/common.py
+4
-4
cms/envs/debug_upload.py
+2
-2
cms/envs/dev.py
+2
-1
cms/envs/devstack.py
+3
-1
cms/envs/devstack_optimized.py
+2
-2
cms/envs/test.py
+6
-6
cms/envs/yaml_config.py
+7
-5
common/djangoapps/third_party_auth/settings.py
+1
-3
common/djangoapps/third_party_auth/tests/test_settings.py
+4
-3
lms/envs/acceptance.py
+1
-1
lms/envs/aws.py
+21
-18
lms/envs/bok_choy.py
+2
-4
lms/envs/cms/acceptance.py
+2
-4
lms/envs/cms/dev.py
+1
-4
lms/envs/common.py
+14
-14
lms/envs/content.py
+2
-1
lms/envs/dev.py
+7
-6
lms/envs/devstack.py
+4
-3
lms/envs/devstack_optimized.py
+1
-3
lms/envs/static.py
+2
-2
lms/envs/test.py
+12
-17
lms/envs/test_with_mysql.py
+2
-2
lms/envs/yaml_config.py
+11
-8
No files found.
cms/envs/acceptance.py
View file @
21791ccb
...
@@ -107,13 +107,13 @@ FEATURES['ENABLE_DISCUSSION_SERVICE'] = False
...
@@ -107,13 +107,13 @@ FEATURES['ENABLE_DISCUSSION_SERVICE'] = False
USE_I18N
=
True
USE_I18N
=
True
# Override the test stub webpack_loader that is installed in test.py.
# Override the test stub webpack_loader that is installed in test.py.
INSTALLED_APPS
=
tuple
(
app
for
app
in
INSTALLED_APPS
if
app
!=
'openedx.tests.util.webpack_loader'
)
INSTALLED_APPS
=
[
app
for
app
in
INSTALLED_APPS
if
app
!=
'openedx.tests.util.webpack_loader'
]
INSTALLED_APPS
+=
(
'webpack_loader'
,
)
INSTALLED_APPS
.
append
(
'webpack_loader'
)
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
# django.contrib.staticfiles used to be loaded by lettuce, now we must add it ourselves
# django.contrib.staticfiles used to be loaded by lettuce, now we must add it ourselves
# django.contrib.staticfiles is not added to lms as there is a ^/static$ route built in to the app
# django.contrib.staticfiles is not added to lms as there is a ^/static$ route built in to the app
INSTALLED_APPS
+=
(
'lettuce.django'
,
)
INSTALLED_APPS
.
append
(
'lettuce.django'
)
LETTUCE_APPS
=
(
'contentstore'
,)
LETTUCE_APPS
=
(
'contentstore'
,)
LETTUCE_BROWSER
=
os
.
environ
.
get
(
'LETTUCE_BROWSER'
,
'chrome'
)
LETTUCE_BROWSER
=
os
.
environ
.
get
(
'LETTUCE_BROWSER'
,
'chrome'
)
...
...
cms/envs/aws.py
View file @
21791ccb
...
@@ -236,7 +236,7 @@ for feature, value in ENV_FEATURES.items():
...
@@ -236,7 +236,7 @@ for feature, value in ENV_FEATURES.items():
# Additional installed apps
# Additional installed apps
for
app
in
ENV_TOKENS
.
get
(
'ADDL_INSTALLED_APPS'
,
[]):
for
app
in
ENV_TOKENS
.
get
(
'ADDL_INSTALLED_APPS'
,
[]):
INSTALLED_APPS
+=
(
app
,
)
INSTALLED_APPS
.
append
(
app
)
WIKI_ENABLED
=
ENV_TOKENS
.
get
(
'WIKI_ENABLED'
,
WIKI_ENABLED
)
WIKI_ENABLED
=
ENV_TOKENS
.
get
(
'WIKI_ENABLED'
,
WIKI_ENABLED
)
...
@@ -259,11 +259,13 @@ if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
...
@@ -259,11 +259,13 @@ if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
CAS_EXTRA_LOGIN_PARAMS
=
ENV_TOKENS
.
get
(
"CAS_EXTRA_LOGIN_PARAMS"
,
None
)
CAS_EXTRA_LOGIN_PARAMS
=
ENV_TOKENS
.
get
(
"CAS_EXTRA_LOGIN_PARAMS"
,
None
)
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
CAS_SERVER_URL
=
ENV_TOKENS
.
get
(
"CAS_SERVER_URL"
,
None
)
CAS_SERVER_URL
=
ENV_TOKENS
.
get
(
"CAS_SERVER_URL"
,
None
)
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'django.contrib.auth.backends.ModelBackend'
,
'django.contrib.auth.backends.ModelBackend'
,
'django_cas.backends.CASBackend'
,
'django_cas.backends.CASBackend'
,
)
]
INSTALLED_APPS
+=
(
'django_cas'
,)
INSTALLED_APPS
.
append
(
'django_cas'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
CAS_ATTRIBUTE_CALLBACK
=
ENV_TOKENS
.
get
(
'CAS_ATTRIBUTE_CALLBACK'
,
None
)
CAS_ATTRIBUTE_CALLBACK
=
ENV_TOKENS
.
get
(
'CAS_ATTRIBUTE_CALLBACK'
,
None
)
if
CAS_ATTRIBUTE_CALLBACK
:
if
CAS_ATTRIBUTE_CALLBACK
:
...
@@ -504,7 +506,7 @@ JWT_AUTH.update(ENV_TOKENS.get('JWT_AUTH', {}))
...
@@ -504,7 +506,7 @@ JWT_AUTH.update(ENV_TOKENS.get('JWT_AUTH', {}))
######################## CUSTOM COURSES for EDX CONNECTOR ######################
######################## CUSTOM COURSES for EDX CONNECTOR ######################
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
INSTALLED_APPS
+=
(
'openedx.core.djangoapps.ccxcon'
,
)
INSTALLED_APPS
.
append
(
'openedx.core.djangoapps.ccxcon'
)
# Partner support link for CMS footer
# Partner support link for CMS footer
PARTNER_SUPPORT_EMAIL
=
ENV_TOKENS
.
get
(
'PARTNER_SUPPORT_EMAIL'
,
PARTNER_SUPPORT_EMAIL
)
PARTNER_SUPPORT_EMAIL
=
ENV_TOKENS
.
get
(
'PARTNER_SUPPORT_EMAIL'
,
PARTNER_SUPPORT_EMAIL
)
...
...
cms/envs/bok_choy.py
View file @
21791ccb
...
@@ -57,9 +57,9 @@ DEBUG = True
...
@@ -57,9 +57,9 @@ DEBUG = True
# Serve static files at /static directly from the staticfiles directory under test root
# Serve static files at /static directly from the staticfiles directory under test root
# Note: optimized files for testing are generated with settings from test_static_optimized
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL
=
"/static/"
STATIC_URL
=
"/static/"
STATICFILES_FINDERS
=
(
STATICFILES_FINDERS
=
[
'django.contrib.staticfiles.finders.FileSystemFinder'
,
'django.contrib.staticfiles.finders.FileSystemFinder'
,
)
]
STATICFILES_DIRS
=
[
STATICFILES_DIRS
=
[
(
TEST_ROOT
/
"staticfiles"
/
"cms"
)
.
abspath
(),
(
TEST_ROOT
/
"staticfiles"
/
"cms"
)
.
abspath
(),
]
]
...
...
cms/envs/common.py
View file @
21791ccb
...
@@ -356,10 +356,10 @@ LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/signin'
...
@@ -356,10 +356,10 @@ LOGIN_REDIRECT_URL = EDX_ROOT_URL + '/signin'
LOGIN_URL
=
EDX_ROOT_URL
+
'/signin'
LOGIN_URL
=
EDX_ROOT_URL
+
'/signin'
# use the ratelimit backend to prevent brute force attacks
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'rules.permissions.ObjectPermissionBackend'
,
'rules.permissions.ObjectPermissionBackend'
,
'ratelimitbackend.backends.RateLimitModelBackend'
,
'ratelimitbackend.backends.RateLimitModelBackend'
,
)
]
LMS_BASE
=
None
LMS_BASE
=
None
LMS_ROOT_URL
=
"http://localhost:8000"
LMS_ROOT_URL
=
"http://localhost:8000"
...
@@ -561,7 +561,7 @@ EMAIL_HOST_PASSWORD = ''
...
@@ -561,7 +561,7 @@ EMAIL_HOST_PASSWORD = ''
DEFAULT_FROM_EMAIL
=
'registration@example.com'
DEFAULT_FROM_EMAIL
=
'registration@example.com'
DEFAULT_FEEDBACK_EMAIL
=
'feedback@example.com'
DEFAULT_FEEDBACK_EMAIL
=
'feedback@example.com'
SERVER_EMAIL
=
'devops@example.com'
SERVER_EMAIL
=
'devops@example.com'
ADMINS
=
()
ADMINS
=
[]
MANAGERS
=
ADMINS
MANAGERS
=
ADMINS
EDX_PLATFORM_REVISION
=
os
.
environ
.
get
(
'EDX_PLATFORM_REVISION'
)
EDX_PLATFORM_REVISION
=
os
.
environ
.
get
(
'EDX_PLATFORM_REVISION'
)
...
@@ -1211,7 +1211,7 @@ for app_name, insert_before in OPTIONAL_APPS:
...
@@ -1211,7 +1211,7 @@ for app_name, insert_before in OPTIONAL_APPS:
try
:
try
:
INSTALLED_APPS
.
insert
(
INSTALLED_APPS
.
index
(
insert_before
),
app_name
)
INSTALLED_APPS
.
insert
(
INSTALLED_APPS
.
index
(
insert_before
),
app_name
)
except
(
IndexError
,
ValueError
):
except
(
IndexError
,
ValueError
):
INSTALLED_APPS
+=
(
app_name
,
)
INSTALLED_APPS
.
append
(
app_name
)
### ADVANCED_SECURITY_CONFIG
### ADVANCED_SECURITY_CONFIG
...
...
cms/envs/debug_upload.py
View file @
21791ccb
...
@@ -5,8 +5,8 @@ progress bars in uploads
...
@@ -5,8 +5,8 @@ progress bars in uploads
# pylint: disable=unused-wildcard-import
# pylint: disable=unused-wildcard-import
from
.dev
import
*
# pylint: disable=wildcard-import
from
.dev
import
*
# pylint: disable=wildcard-import
FILE_UPLOAD_HANDLERS
=
(
FILE_UPLOAD_HANDLERS
=
[
'contentstore.debug_file_uploader.DebugFileUploader'
,
'contentstore.debug_file_uploader.DebugFileUploader'
,
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
)
]
cms/envs/dev.py
View file @
21791ccb
...
@@ -141,7 +141,8 @@ PIPELINE_SASS_ARGUMENTS = '--debug-info'
...
@@ -141,7 +141,8 @@ PIPELINE_SASS_ARGUMENTS = '--debug-info'
CELERY_ALWAYS_EAGER
=
True
CELERY_ALWAYS_EAGER
=
True
################################ DEBUG TOOLBAR #################################
################################ DEBUG TOOLBAR #################################
INSTALLED_APPS
+=
(
'debug_toolbar'
,
'debug_toolbar_mongo'
,
'djpyfs'
)
INSTALLED_APPS
+=
[
'debug_toolbar'
,
'debug_toolbar_mongo'
,
'djpyfs'
]
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
...
...
cms/envs/devstack.py
View file @
21791ccb
...
@@ -63,7 +63,9 @@ DJFS = {
...
@@ -63,7 +63,9 @@ DJFS = {
CELERY_ALWAYS_EAGER
=
True
CELERY_ALWAYS_EAGER
=
True
################################ DEBUG TOOLBAR ################################
################################ DEBUG TOOLBAR ################################
INSTALLED_APPS
+=
(
'debug_toolbar'
,
'debug_toolbar_mongo'
)
INSTALLED_APPS
+=
[
'debug_toolbar'
,
'debug_toolbar_mongo'
]
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
...
...
cms/envs/devstack_optimized.py
View file @
21791ccb
...
@@ -43,9 +43,9 @@ STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
...
@@ -43,9 +43,9 @@ STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
# Serve static files at /static directly from the staticfiles directory under test root.
# Serve static files at /static directly from the staticfiles directory under test root.
# Note: optimized files for testing are generated with settings from test_static_optimized
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL
=
"/static/"
STATIC_URL
=
"/static/"
STATICFILES_FINDERS
=
(
STATICFILES_FINDERS
=
[
'django.contrib.staticfiles.finders.FileSystemFinder'
,
'django.contrib.staticfiles.finders.FileSystemFinder'
,
)
]
STATICFILES_DIRS
=
[
STATICFILES_DIRS
=
[
(
TEST_ROOT
/
"staticfiles"
/
"cms"
)
.
abspath
(),
(
TEST_ROOT
/
"staticfiles"
/
"cms"
)
.
abspath
(),
]
]
cms/envs/test.py
View file @
21791ccb
...
@@ -67,8 +67,8 @@ TEST_ROOT = path('test_root')
...
@@ -67,8 +67,8 @@ TEST_ROOT = path('test_root')
# Want static files in the same dir for running on jenkins.
# Want static files in the same dir for running on jenkins.
STATIC_ROOT
=
TEST_ROOT
/
"staticfiles"
STATIC_ROOT
=
TEST_ROOT
/
"staticfiles"
INSTALLED_APPS
=
tuple
(
app
for
app
in
INSTALLED_APPS
if
app
!=
'webpack_loader'
)
INSTALLED_APPS
=
[
app
for
app
in
INSTALLED_APPS
if
app
!=
'webpack_loader'
]
INSTALLED_APPS
+=
(
'openedx.tests.util.webpack_loader'
,
)
INSTALLED_APPS
.
append
(
'openedx.tests.util.webpack_loader'
)
WEBPACK_LOADER
[
'DEFAULT'
][
'STATS_FILE'
]
=
STATIC_ROOT
/
"webpack-stats.json"
WEBPACK_LOADER
[
'DEFAULT'
][
'STATS_FILE'
]
=
STATIC_ROOT
/
"webpack-stats.json"
GITHUB_REPO_ROOT
=
TEST_ROOT
/
"data"
GITHUB_REPO_ROOT
=
TEST_ROOT
/
"data"
...
@@ -215,10 +215,10 @@ VIDEO_SOURCE_PORT = 8777
...
@@ -215,10 +215,10 @@ VIDEO_SOURCE_PORT = 8777
################### Make tests faster
################### Make tests faster
# http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
# http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
PASSWORD_HASHERS
=
(
PASSWORD_HASHERS
=
[
'django.contrib.auth.hashers.SHA1PasswordHasher'
,
'django.contrib.auth.hashers.SHA1PasswordHasher'
,
'django.contrib.auth.hashers.MD5PasswordHasher'
,
'django.contrib.auth.hashers.MD5PasswordHasher'
,
)
]
# No segment key
# No segment key
CMS_SEGMENT_KEY
=
None
CMS_SEGMENT_KEY
=
None
...
@@ -336,11 +336,11 @@ FEATURES['ENABLE_TEAMS'] = True
...
@@ -336,11 +336,11 @@ FEATURES['ENABLE_TEAMS'] = True
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
SECRET_KEY
=
'85920908f28904ed733fe576320db18cabd7b6cd'
######### custom courses #########
######### custom courses #########
INSTALLED_APPS
+=
(
'openedx.core.djangoapps.ccxcon'
,
)
INSTALLED_APPS
.
append
(
'openedx.core.djangoapps.ccxcon'
)
FEATURES
[
'CUSTOM_COURSES_EDX'
]
=
True
FEATURES
[
'CUSTOM_COURSES_EDX'
]
=
True
# API access management -- needed for simple-history to run.
# API access management -- needed for simple-history to run.
INSTALLED_APPS
+=
(
'openedx.core.djangoapps.api_admin'
,
)
INSTALLED_APPS
.
append
(
'openedx.core.djangoapps.api_admin'
)
########################## VIDEO IMAGE STORAGE ############################
########################## VIDEO IMAGE STORAGE ############################
VIDEO_IMAGE_SETTINGS
=
dict
(
VIDEO_IMAGE_SETTINGS
=
dict
(
...
...
cms/envs/yaml_config.py
View file @
21791ccb
...
@@ -194,7 +194,7 @@ if SESSION_COOKIE_NAME:
...
@@ -194,7 +194,7 @@ if SESSION_COOKIE_NAME:
# Additional installed apps
# Additional installed apps
for
app
in
ADDL_INSTALLED_APPS
:
for
app
in
ADDL_INSTALLED_APPS
:
INSTALLED_APPS
+=
(
app
,
)
INSTALLED_APPS
.
append
(
app
)
LOGGING
=
get_logger_config
(
LOG_DIR
,
LOGGING
=
get_logger_config
(
LOG_DIR
,
...
@@ -204,11 +204,13 @@ LOGGING = get_logger_config(LOG_DIR,
...
@@ -204,11 +204,13 @@ LOGGING = get_logger_config(LOG_DIR,
service_variant
=
SERVICE_VARIANT
)
service_variant
=
SERVICE_VARIANT
)
if
AUTH_USE_CAS
:
if
AUTH_USE_CAS
:
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'django.contrib.auth.backends.ModelBackend'
,
'django.contrib.auth.backends.ModelBackend'
,
'django_cas.backends.CASBackend'
,
'django_cas.backends.CASBackend'
,
)
]
INSTALLED_APPS
+=
(
'django_cas'
,)
INSTALLED_APPS
.
append
(
'django_cas'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
if
CAS_ATTRIBUTE_CALLBACK
:
if
CAS_ATTRIBUTE_CALLBACK
:
import
importlib
import
importlib
...
@@ -256,7 +258,7 @@ BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
...
@@ -256,7 +258,7 @@ BROKER_USE_SSL = ENV_TOKENS.get('CELERY_BROKER_USE_SSL', False)
######################## CUSTOM COURSES for EDX CONNECTOR ######################
######################## CUSTOM COURSES for EDX CONNECTOR ######################
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
INSTALLED_APPS
+=
(
'openedx.core.djangoapps.ccxcon'
,
)
INSTALLED_APPS
.
append
(
'openedx.core.djangoapps.ccxcon'
)
########################## Extra middleware classes #######################
########################## Extra middleware classes #######################
...
...
common/djangoapps/third_party_auth/settings.py
View file @
21791ccb
...
@@ -11,9 +11,7 @@ If true, it:
...
@@ -11,9 +11,7 @@ If true, it:
"""
"""
_FIELDS_STORED_IN_SESSION
=
[
'auth_entry'
,
'next'
]
_FIELDS_STORED_IN_SESSION
=
[
'auth_entry'
,
'next'
]
_MIDDLEWARE_CLASSES
=
[
_MIDDLEWARE_CLASSES
=
[
'third_party_auth.middleware.ExceptionMiddleware'
]
'third_party_auth.middleware.ExceptionMiddleware'
,
]
_SOCIAL_AUTH_LOGIN_REDIRECT_URL
=
'/dashboard'
_SOCIAL_AUTH_LOGIN_REDIRECT_URL
=
'/dashboard'
_SOCIAL_AUTH_AZUREAD_OAUTH2_AUTH_EXTRA_ARGUMENTS
=
{
_SOCIAL_AUTH_AZUREAD_OAUTH2_AUTH_EXTRA_ARGUMENTS
=
{
'msafed'
:
0
'msafed'
:
0
...
...
common/djangoapps/third_party_auth/tests/test_settings.py
View file @
21791ccb
...
@@ -5,10 +5,11 @@ import unittest
...
@@ -5,10 +5,11 @@ import unittest
from
third_party_auth
import
provider
,
settings
from
third_party_auth
import
provider
,
settings
from
third_party_auth.tests
import
testutil
from
third_party_auth.tests
import
testutil
_ORIGINAL_AUTHENTICATION_BACKENDS
=
(
'first_authentication_backend'
,)
_ORIGINAL_INSTALLED_APPS
=
(
'first_installed_app'
,)
_ORIGINAL_AUTHENTICATION_BACKENDS
=
[
'first_authentication_backend'
]
_ORIGINAL_INSTALLED_APPS
=
[
'first_installed_app'
]
_ORIGINAL_MIDDLEWARE_CLASSES
=
[
'first_middleware_class'
]
_ORIGINAL_MIDDLEWARE_CLASSES
=
[
'first_middleware_class'
]
_ORIGINAL_TEMPLATE_CONTEXT_PROCESSORS
=
(
'first_template_context_preprocessor'
,)
_ORIGINAL_TEMPLATE_CONTEXT_PROCESSORS
=
[
'first_template_context_preprocessor'
]
_SETTINGS_MAP
=
{
_SETTINGS_MAP
=
{
'AUTHENTICATION_BACKENDS'
:
_ORIGINAL_AUTHENTICATION_BACKENDS
,
'AUTHENTICATION_BACKENDS'
:
_ORIGINAL_AUTHENTICATION_BACKENDS
,
'INSTALLED_APPS'
:
_ORIGINAL_INSTALLED_APPS
,
'INSTALLED_APPS'
:
_ORIGINAL_INSTALLED_APPS
,
...
...
lms/envs/acceptance.py
View file @
21791ccb
...
@@ -142,7 +142,7 @@ USE_I18N = True
...
@@ -142,7 +142,7 @@ USE_I18N = True
FEATURES
[
'ENABLE_FEEDBACK_SUBMISSION'
]
=
False
FEATURES
[
'ENABLE_FEEDBACK_SUBMISSION'
]
=
False
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS
+=
(
'lettuce.django'
,
)
INSTALLED_APPS
.
append
(
'lettuce.django'
)
LETTUCE_APPS
=
(
'courseware'
,
'instructor'
)
LETTUCE_APPS
=
(
'courseware'
,
'instructor'
)
# Lettuce appears to have a bug that causes it to search
# Lettuce appears to have a bug that causes it to search
...
...
lms/envs/aws.py
View file @
21791ccb
...
@@ -339,7 +339,7 @@ USE_I18N = ENV_TOKENS.get('USE_I18N', USE_I18N)
...
@@ -339,7 +339,7 @@ USE_I18N = ENV_TOKENS.get('USE_I18N', USE_I18N)
# Additional installed apps
# Additional installed apps
for
app
in
ENV_TOKENS
.
get
(
'ADDL_INSTALLED_APPS'
,
[]):
for
app
in
ENV_TOKENS
.
get
(
'ADDL_INSTALLED_APPS'
,
[]):
INSTALLED_APPS
+=
(
app
,
)
INSTALLED_APPS
.
append
(
app
)
WIKI_ENABLED
=
ENV_TOKENS
.
get
(
'WIKI_ENABLED'
,
WIKI_ENABLED
)
WIKI_ENABLED
=
ENV_TOKENS
.
get
(
'WIKI_ENABLED'
,
WIKI_ENABLED
)
local_loglevel
=
ENV_TOKENS
.
get
(
'LOCAL_LOGLEVEL'
,
'INFO'
)
local_loglevel
=
ENV_TOKENS
.
get
(
'LOCAL_LOGLEVEL'
,
'INFO'
)
...
@@ -399,11 +399,13 @@ SSL_AUTH_DN_FORMAT_STRING = ENV_TOKENS.get(
...
@@ -399,11 +399,13 @@ SSL_AUTH_DN_FORMAT_STRING = ENV_TOKENS.get(
CAS_EXTRA_LOGIN_PARAMS
=
ENV_TOKENS
.
get
(
"CAS_EXTRA_LOGIN_PARAMS"
,
None
)
CAS_EXTRA_LOGIN_PARAMS
=
ENV_TOKENS
.
get
(
"CAS_EXTRA_LOGIN_PARAMS"
,
None
)
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
CAS_SERVER_URL
=
ENV_TOKENS
.
get
(
"CAS_SERVER_URL"
,
None
)
CAS_SERVER_URL
=
ENV_TOKENS
.
get
(
"CAS_SERVER_URL"
,
None
)
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'django.contrib.auth.backends.ModelBackend'
,
'django.contrib.auth.backends.ModelBackend'
,
'django_cas.backends.CASBackend'
,
'django_cas.backends.CASBackend'
,
)
]
INSTALLED_APPS
+=
(
'django_cas'
,)
INSTALLED_APPS
.
append
(
'django_cas'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
CAS_ATTRIBUTE_CALLBACK
=
ENV_TOKENS
.
get
(
'CAS_ATTRIBUTE_CALLBACK'
,
None
)
CAS_ATTRIBUTE_CALLBACK
=
ENV_TOKENS
.
get
(
'CAS_ATTRIBUTE_CALLBACK'
,
None
)
if
CAS_ATTRIBUTE_CALLBACK
:
if
CAS_ATTRIBUTE_CALLBACK
:
...
@@ -675,16 +677,17 @@ X_FRAME_OPTIONS = ENV_TOKENS.get('X_FRAME_OPTIONS', X_FRAME_OPTIONS)
...
@@ -675,16 +677,17 @@ X_FRAME_OPTIONS = ENV_TOKENS.get('X_FRAME_OPTIONS', X_FRAME_OPTIONS)
##### Third-party auth options ################################################
##### Third-party auth options ################################################
if
FEATURES
.
get
(
'ENABLE_THIRD_PARTY_AUTH'
):
if
FEATURES
.
get
(
'ENABLE_THIRD_PARTY_AUTH'
):
AUTHENTICATION_BACKENDS
=
(
tmp_backends
=
ENV_TOKENS
.
get
(
'THIRD_PARTY_AUTH_BACKENDS'
,
[
ENV_TOKENS
.
get
(
'THIRD_PARTY_AUTH_BACKENDS'
,
[
'social_core.backends.google.GoogleOAuth2'
,
'social_core.backends.google.GoogleOAuth2'
,
'social_core.backends.linkedin.LinkedinOAuth2'
,
'social_core.backends.linkedin.LinkedinOAuth2'
,
'social_core.backends.facebook.FacebookOAuth2'
,
'social_core.backends.facebook.FacebookOAuth2'
,
'social_core.backends.azuread.AzureADOAuth2'
,
'social_core.backends.azuread.AzureADOAuth2'
,
'third_party_auth.saml.SAMLAuthBackend'
,
'third_party_auth.saml.SAMLAuthBackend'
,
'third_party_auth.lti.LTIAuthBackend'
,
'third_party_auth.lti.LTIAuthBackend'
,
])
])
+
list
(
AUTHENTICATION_BACKENDS
)
)
AUTHENTICATION_BACKENDS
=
list
(
tmp_backends
)
+
list
(
AUTHENTICATION_BACKENDS
)
del
tmp_backends
# The reduced session expiry time during the third party login pipeline. (Value in seconds)
# The reduced session expiry time during the third party login pipeline. (Value in seconds)
SOCIAL_AUTH_PIPELINE_TIMEOUT
=
ENV_TOKENS
.
get
(
'SOCIAL_AUTH_PIPELINE_TIMEOUT'
,
600
)
SOCIAL_AUTH_PIPELINE_TIMEOUT
=
ENV_TOKENS
.
get
(
'SOCIAL_AUTH_PIPELINE_TIMEOUT'
,
600
)
...
@@ -819,7 +822,7 @@ ECOMMERCE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get(
...
@@ -819,7 +822,7 @@ ECOMMERCE_SERVICE_WORKER_USERNAME = ENV_TOKENS.get(
##### Custom Courses for EdX #####
##### Custom Courses for EdX #####
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
INSTALLED_APPS
+=
(
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
)
INSTALLED_APPS
+=
[
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
]
MODULESTORE_FIELD_OVERRIDE_PROVIDERS
+=
(
MODULESTORE_FIELD_OVERRIDE_PROVIDERS
+=
(
'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider'
,
'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider'
,
)
)
...
@@ -865,8 +868,8 @@ CREDIT_PROVIDER_SECRET_KEYS = AUTH_TOKENS.get("CREDIT_PROVIDER_SECRET_KEYS", {})
...
@@ -865,8 +868,8 @@ CREDIT_PROVIDER_SECRET_KEYS = AUTH_TOKENS.get("CREDIT_PROVIDER_SECRET_KEYS", {})
##################### LTI Provider #####################
##################### LTI Provider #####################
if
FEATURES
.
get
(
'ENABLE_LTI_PROVIDER'
):
if
FEATURES
.
get
(
'ENABLE_LTI_PROVIDER'
):
INSTALLED_APPS
+=
(
'lti_provider'
,
)
INSTALLED_APPS
.
append
(
'lti_provider'
)
AUTHENTICATION_BACKENDS
+=
(
'lti_provider.users.LtiBackend'
,
)
AUTHENTICATION_BACKENDS
.
append
(
'lti_provider.users.LtiBackend'
)
LTI_USER_EMAIL_DOMAIN
=
ENV_TOKENS
.
get
(
'LTI_USER_EMAIL_DOMAIN'
,
'lti.example.com'
)
LTI_USER_EMAIL_DOMAIN
=
ENV_TOKENS
.
get
(
'LTI_USER_EMAIL_DOMAIN'
,
'lti.example.com'
)
...
@@ -918,7 +921,7 @@ CREDENTIALS_GENERATION_ROUTING_KEY = ENV_TOKENS.get('CREDENTIALS_GENERATION_ROUT
...
@@ -918,7 +921,7 @@ CREDENTIALS_GENERATION_ROUTING_KEY = ENV_TOKENS.get('CREDENTIALS_GENERATION_ROUT
# The extended StudentModule history table
# The extended StudentModule history table
if
FEATURES
.
get
(
'ENABLE_CSMH_EXTENDED'
):
if
FEATURES
.
get
(
'ENABLE_CSMH_EXTENDED'
):
INSTALLED_APPS
+=
(
'coursewarehistoryextended'
,
)
INSTALLED_APPS
.
append
(
'coursewarehistoryextended'
)
API_ACCESS_MANAGER_EMAIL
=
ENV_TOKENS
.
get
(
'API_ACCESS_MANAGER_EMAIL'
)
API_ACCESS_MANAGER_EMAIL
=
ENV_TOKENS
.
get
(
'API_ACCESS_MANAGER_EMAIL'
)
API_ACCESS_FROM_EMAIL
=
ENV_TOKENS
.
get
(
'API_ACCESS_FROM_EMAIL'
)
API_ACCESS_FROM_EMAIL
=
ENV_TOKENS
.
get
(
'API_ACCESS_FROM_EMAIL'
)
...
...
lms/envs/bok_choy.py
View file @
21791ccb
...
@@ -57,9 +57,7 @@ DEBUG = True
...
@@ -57,9 +57,7 @@ DEBUG = True
# Serve static files at /static directly from the staticfiles directory under test root
# Serve static files at /static directly from the staticfiles directory under test root
# Note: optimized files for testing are generated with settings from test_static_optimized
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL
=
"/static/"
STATIC_URL
=
"/static/"
STATICFILES_FINDERS
=
(
STATICFILES_FINDERS
=
[
'django.contrib.staticfiles.finders.FileSystemFinder'
]
'django.contrib.staticfiles.finders.FileSystemFinder'
,
)
STATICFILES_DIRS
=
[
STATICFILES_DIRS
=
[
(
TEST_ROOT
/
"staticfiles"
/
"lms"
)
.
abspath
(),
(
TEST_ROOT
/
"staticfiles"
/
"lms"
)
.
abspath
(),
]
]
...
@@ -221,7 +219,7 @@ PROFILE_IMAGE_BACKEND = {
...
@@ -221,7 +219,7 @@ PROFILE_IMAGE_BACKEND = {
# Make sure we test with the extended history table
# Make sure we test with the extended history table
FEATURES
[
'ENABLE_CSMH_EXTENDED'
]
=
True
FEATURES
[
'ENABLE_CSMH_EXTENDED'
]
=
True
INSTALLED_APPS
+=
(
'coursewarehistoryextended'
,
)
INSTALLED_APPS
.
append
(
'coursewarehistoryextended'
)
BADGING_BACKEND
=
'lms.djangoapps.badges.backends.tests.dummy_backend.DummyBackend'
BADGING_BACKEND
=
'lms.djangoapps.badges.backends.tests.dummy_backend.DummyBackend'
...
...
lms/envs/cms/acceptance.py
View file @
21791ccb
...
@@ -12,8 +12,7 @@ from .dev import *
...
@@ -12,8 +12,7 @@ from .dev import *
# REMOVE DEBUG TOOLBAR
# REMOVE DEBUG TOOLBAR
INSTALLED_APPS
=
tuple
(
e
for
e
in
INSTALLED_APPS
if
e
!=
'debug_toolbar'
)
INSTALLED_APPS
=
[
e
for
e
in
INSTALLED_APPS
if
e
!=
'debug_toolbar'
and
e
!=
'debug_toolbar_mongo'
]
INSTALLED_APPS
=
tuple
(
e
for
e
in
INSTALLED_APPS
if
e
!=
'debug_toolbar_mongo'
)
MIDDLEWARE_CLASSES
=
[
e
for
e
in
MIDDLEWARE_CLASSES
if
e
!=
'debug_toolbar.middleware.DebugToolbarMiddleware'
]
MIDDLEWARE_CLASSES
=
[
e
for
e
in
MIDDLEWARE_CLASSES
if
e
!=
'debug_toolbar.middleware.DebugToolbarMiddleware'
]
...
@@ -21,7 +20,6 @@ MIDDLEWARE_CLASSES = [e for e in MIDDLEWARE_CLASSES if e != 'debug_toolbar.middl
...
@@ -21,7 +20,6 @@ MIDDLEWARE_CLASSES = [e for e in MIDDLEWARE_CLASSES if e != 'debug_toolbar.middl
########################### LETTUCE TESTING ##########################
########################### LETTUCE TESTING ##########################
FEATURES
[
'DISPLAY_TOY_COURSES'
]
=
True
FEATURES
[
'DISPLAY_TOY_COURSES'
]
=
True
INSTALLED_APPS
+=
(
'lettuce.django'
,)
INSTALLED_APPS
.
append
(
'lettuce.django'
)
# INSTALLED_APPS += ('portal',)
LETTUCE_APPS
=
(
'portal'
,)
# dummy app covers the home page, login, registration, and course enrollment
LETTUCE_APPS
=
(
'portal'
,)
# dummy app covers the home page, login, registration, and course enrollment
lms/envs/cms/dev.py
View file @
21791ccb
...
@@ -28,10 +28,7 @@ CONTENTSTORE = {
...
@@ -28,10 +28,7 @@ CONTENTSTORE = {
}
}
}
}
INSTALLED_APPS
+=
(
INSTALLED_APPS
.
append
(
'debug_toolbar_mongo'
)
# Mongo perf stats
'debug_toolbar_mongo'
,
)
DEBUG_TOOLBAR_PANELS
+=
(
DEBUG_TOOLBAR_PANELS
+=
(
...
...
lms/envs/common.py
View file @
21791ccb
...
@@ -599,9 +599,7 @@ DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0]
...
@@ -599,9 +599,7 @@ DEFAULT_TEMPLATE_ENGINE = TEMPLATES[0]
###############################################################################################
###############################################################################################
# use the ratelimit backend to prevent brute force attacks
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'ratelimitbackend.backends.RateLimitModelBackend'
]
'ratelimitbackend.backends.RateLimitModelBackend'
,
)
STUDENT_FILEUPLOAD_MAX_SIZE
=
4
*
1000
*
1000
# 4 MB
STUDENT_FILEUPLOAD_MAX_SIZE
=
4
*
1000
*
1000
# 4 MB
MAX_FILEUPLOADS_PER_INPUT
=
20
MAX_FILEUPLOADS_PER_INPUT
=
20
...
@@ -918,7 +916,7 @@ LANGUAGES_BIDI = ("he", "ar", "fa", "ur", "fa-ir", "rtl")
...
@@ -918,7 +916,7 @@ LANGUAGES_BIDI = ("he", "ar", "fa", "ur", "fa-ir", "rtl")
LANGUAGE_COOKIE
=
"openedx-language-preference"
LANGUAGE_COOKIE
=
"openedx-language-preference"
# Sourced from http://www.localeplanet.com/icu/ and wikipedia
# Sourced from http://www.localeplanet.com/icu/ and wikipedia
LANGUAGES
=
(
LANGUAGES
=
[
(
'en'
,
u'English'
),
(
'en'
,
u'English'
),
(
'rtl'
,
u'Right-to-Left Test Language'
),
(
'rtl'
,
u'Right-to-Left Test Language'
),
(
'eo'
,
u'Dummy Language (Esperanto)'
),
# Dummy languaged used for testing
(
'eo'
,
u'Dummy Language (Esperanto)'
),
# Dummy languaged used for testing
...
@@ -1000,7 +998,7 @@ LANGUAGES = (
...
@@ -1000,7 +998,7 @@ LANGUAGES = (
(
'zh-cn'
,
u'中文 (简体)'
),
# Chinese (China)
(
'zh-cn'
,
u'中文 (简体)'
),
# Chinese (China)
(
'zh-hk'
,
u'中文 (香港)'
),
# Chinese (Hong Kong)
(
'zh-hk'
,
u'中文 (香港)'
),
# Chinese (Hong Kong)
(
'zh-tw'
,
u'中文 (台灣)'
),
# Chinese (Taiwan)
(
'zh-tw'
,
u'中文 (台灣)'
),
# Chinese (Taiwan)
)
]
LANGUAGE_DICT
=
dict
(
LANGUAGES
)
LANGUAGE_DICT
=
dict
(
LANGUAGES
)
...
@@ -2459,7 +2457,7 @@ DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH = "verify_student_disable_account_
...
@@ -2459,7 +2457,7 @@ DISABLE_ACCOUNT_ACTIVATION_REQUIREMENT_SWITCH = "verify_student_disable_account_
### This enables the Metrics tab for the Instructor dashboard ###########
### This enables the Metrics tab for the Instructor dashboard ###########
FEATURES
[
'CLASS_DASHBOARD'
]
=
False
FEATURES
[
'CLASS_DASHBOARD'
]
=
False
if
FEATURES
.
get
(
'CLASS_DASHBOARD'
):
if
FEATURES
.
get
(
'CLASS_DASHBOARD'
):
INSTALLED_APPS
+=
(
'class_dashboard'
,
)
INSTALLED_APPS
.
append
(
'class_dashboard'
)
################ Enable credit eligibility feature ####################
################ Enable credit eligibility feature ####################
ENABLE_CREDIT_ELIGIBILITY
=
True
ENABLE_CREDIT_ELIGIBILITY
=
True
...
@@ -2469,11 +2467,13 @@ FEATURES['ENABLE_CREDIT_ELIGIBILITY'] = ENABLE_CREDIT_ELIGIBILITY
...
@@ -2469,11 +2467,13 @@ FEATURES['ENABLE_CREDIT_ELIGIBILITY'] = ENABLE_CREDIT_ELIGIBILITY
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
CAS_SERVER_URL
=
'https://provide_your_cas_url_here'
CAS_SERVER_URL
=
'https://provide_your_cas_url_here'
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'django.contrib.auth.backends.ModelBackend'
,
'django.contrib.auth.backends.ModelBackend'
,
'django_cas.backends.CASBackend'
,
'django_cas.backends.CASBackend'
,
)
]
INSTALLED_APPS
+=
(
'django_cas'
,)
INSTALLED_APPS
.
append
(
'django_cas'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
############# Cross-domain requests #################
############# Cross-domain requests #################
...
@@ -2627,7 +2627,7 @@ VIDEO_TRANSCRIPTS_SETTINGS = dict(
...
@@ -2627,7 +2627,7 @@ VIDEO_TRANSCRIPTS_SETTINGS = dict(
# http://loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt according to http://en.wikipedia.org/wiki/ISO_639-1
# http://loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt according to http://en.wikipedia.org/wiki/ISO_639-1
# Note that this is used as the set of choices to the `code` field of the
# Note that this is used as the set of choices to the `code` field of the
# `LanguageProficiency` model.
# `LanguageProficiency` model.
ALL_LANGUAGES
=
(
ALL_LANGUAGES
=
[
[
u"aa"
,
u"Afar"
],
[
u"aa"
,
u"Afar"
],
[
u"ab"
,
u"Abkhazian"
],
[
u"ab"
,
u"Abkhazian"
],
[
u"af"
,
u"Afrikaans"
],
[
u"af"
,
u"Afrikaans"
],
...
@@ -2814,13 +2814,13 @@ ALL_LANGUAGES = (
...
@@ -2814,13 +2814,13 @@ ALL_LANGUAGES = (
[
u"yo"
,
u"Yoruba"
],
[
u"yo"
,
u"Yoruba"
],
[
u"za"
,
u"Zhuang"
],
[
u"za"
,
u"Zhuang"
],
[
u"zu"
,
u"Zulu"
]
[
u"zu"
,
u"Zulu"
]
)
]
### Apps only installed in some instances
### Apps only installed in some instances
# The order of INSTALLED_APPS matters, so this tuple is the app name and the item in INSTALLED_APPS
# The order of INSTALLED_APPS matters, so this tuple is the app name and the item in INSTALLED_APPS
# that this app should be inserted *before*. A None here means it should be appended to the list.
# that this app should be inserted *before*. A None here means it should be appended to the list.
OPTIONAL_APPS
=
(
OPTIONAL_APPS
=
[
(
'mentoring'
,
None
),
(
'mentoring'
,
None
),
(
'problem_builder'
,
'openedx.core.djangoapps.content.course_overviews'
),
(
'problem_builder'
,
'openedx.core.djangoapps.content.course_overviews'
),
(
'edx_sga'
,
None
),
(
'edx_sga'
,
None
),
...
@@ -2850,7 +2850,7 @@ OPTIONAL_APPS = (
...
@@ -2850,7 +2850,7 @@ OPTIONAL_APPS = (
# Required by the Enterprise App
# Required by the Enterprise App
(
'django_object_actions'
,
None
),
# https://github.com/crccheck/django-object-actions
(
'django_object_actions'
,
None
),
# https://github.com/crccheck/django-object-actions
)
]
for
app_name
,
insert_before
in
OPTIONAL_APPS
:
for
app_name
,
insert_before
in
OPTIONAL_APPS
:
# First attempt to only find the module rather than actually importing it,
# First attempt to only find the module rather than actually importing it,
...
@@ -2867,7 +2867,7 @@ for app_name, insert_before in OPTIONAL_APPS:
...
@@ -2867,7 +2867,7 @@ for app_name, insert_before in OPTIONAL_APPS:
try
:
try
:
INSTALLED_APPS
.
insert
(
INSTALLED_APPS
.
index
(
insert_before
),
app_name
)
INSTALLED_APPS
.
insert
(
INSTALLED_APPS
.
index
(
insert_before
),
app_name
)
except
(
IndexError
,
ValueError
):
except
(
IndexError
,
ValueError
):
INSTALLED_APPS
+=
(
app_name
,
)
INSTALLED_APPS
.
append
(
app_name
)
### ADVANCED_SECURITY_CONFIG
### ADVANCED_SECURITY_CONFIG
# Empty by default
# Empty by default
...
...
lms/envs/content.py
View file @
21791ccb
...
@@ -15,7 +15,8 @@ TEMPLATE_DEBUG = True
...
@@ -15,7 +15,8 @@ TEMPLATE_DEBUG = True
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
EMAIL_BACKEND
=
'django.core.mail.backends.console.EmailBackend'
################################ DEBUG TOOLBAR #################################
################################ DEBUG TOOLBAR #################################
INSTALLED_APPS
+=
(
'debug_toolbar'
,)
INSTALLED_APPS
.
append
(
'debug_toolbar'
)
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
MIDDLEWARE_CLASSES
.
append
(
'debug_toolbar.middleware.DebugToolbarMiddleware'
)
DEBUG_TOOLBAR_PANELS
=
(
DEBUG_TOOLBAR_PANELS
=
(
...
...
lms/envs/dev.py
View file @
21791ccb
...
@@ -161,7 +161,7 @@ EDX_PLATFORM_VERSION_STRING = os.popen('cd %s; git describe' % REPO_ROOT).read()
...
@@ -161,7 +161,7 @@ EDX_PLATFORM_VERSION_STRING = os.popen('cd %s; git describe' % REPO_ROOT).read()
FEATURES
[
'ENABLE_LMS_MIGRATION'
]
=
True
FEATURES
[
'ENABLE_LMS_MIGRATION'
]
=
True
FEATURES
[
'XQA_SERVER'
]
=
'http://xqa:server@content-qa.edX.mit.edu/xqa'
FEATURES
[
'XQA_SERVER'
]
=
'http://xqa:server@content-qa.edX.mit.edu/xqa'
INSTALLED_APPS
+=
(
'lms_migration'
,
)
INSTALLED_APPS
.
append
(
'lms_migration'
)
LMS_MIGRATION_ALLOWED_IPS
=
[
'127.0.0.1'
]
LMS_MIGRATION_ALLOWED_IPS
=
[
'127.0.0.1'
]
...
@@ -196,11 +196,12 @@ CELERY_ALWAYS_EAGER = True
...
@@ -196,11 +196,12 @@ CELERY_ALWAYS_EAGER = True
################################ DEBUG TOOLBAR ################################
################################ DEBUG TOOLBAR ################################
INSTALLED_APPS
+=
(
'debug_toolbar'
,
'djpyfs'
,)
INSTALLED_APPS
+=
[
'debug_toolbar'
,
'djpyfs'
]
MIDDLEWARE_CLASSES
.
extend
(
[
MIDDLEWARE_CLASSES
+=
[
'django_comment_client.utils.QueryCountDebugMiddleware'
,
'django_comment_client.utils.QueryCountDebugMiddleware'
,
'debug_toolbar.middleware.DebugToolbarMiddleware'
,
'debug_toolbar.middleware.DebugToolbarMiddleware'
,
])
]
INTERNAL_IPS
=
(
'127.0.0.1'
,)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
DEBUG_TOOLBAR_PANELS
=
(
DEBUG_TOOLBAR_PANELS
=
(
...
@@ -222,10 +223,10 @@ MEDIA_ROOT = ENV_ROOT / "uploads"
...
@@ -222,10 +223,10 @@ MEDIA_ROOT = ENV_ROOT / "uploads"
MEDIA_URL
=
"/static/uploads/"
MEDIA_URL
=
"/static/uploads/"
STATICFILES_DIRS
.
append
((
"uploads"
,
MEDIA_ROOT
))
STATICFILES_DIRS
.
append
((
"uploads"
,
MEDIA_ROOT
))
FILE_UPLOAD_TEMP_DIR
=
ENV_ROOT
/
"uploads"
FILE_UPLOAD_TEMP_DIR
=
ENV_ROOT
/
"uploads"
FILE_UPLOAD_HANDLERS
=
(
FILE_UPLOAD_HANDLERS
=
[
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
)
]
FEATURES
[
'AUTH_USE_SHIB'
]
=
True
FEATURES
[
'AUTH_USE_SHIB'
]
=
True
FEATURES
[
'RESTRICT_ENROLL_BY_REG_METHOD'
]
=
True
FEATURES
[
'RESTRICT_ENROLL_BY_REG_METHOD'
]
=
True
...
...
lms/envs/devstack.py
View file @
21791ccb
...
@@ -57,11 +57,12 @@ DJFS = {
...
@@ -57,11 +57,12 @@ DJFS = {
################################ DEBUG TOOLBAR ################################
################################ DEBUG TOOLBAR ################################
INSTALLED_APPS
+=
(
'debug_toolbar'
,
'debug_toolbar_mongo'
)
INSTALLED_APPS
+=
[
'debug_toolbar'
,
'debug_toolbar_mongo'
]
MIDDLEWARE_CLASSES
.
extend
(
[
MIDDLEWARE_CLASSES
+=
[
'django_comment_client.utils.QueryCountDebugMiddleware'
,
'django_comment_client.utils.QueryCountDebugMiddleware'
,
'debug_toolbar.middleware.DebugToolbarMiddleware'
,
'debug_toolbar.middleware.DebugToolbarMiddleware'
,
])
]
INTERNAL_IPS
=
(
'127.0.0.1'
,)
INTERNAL_IPS
=
(
'127.0.0.1'
,)
DEBUG_TOOLBAR_PANELS
=
(
DEBUG_TOOLBAR_PANELS
=
(
...
...
lms/envs/devstack_optimized.py
View file @
21791ccb
...
@@ -43,9 +43,7 @@ STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
...
@@ -43,9 +43,7 @@ STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
# Serve static files at /static directly from the staticfiles directory under test root.
# Serve static files at /static directly from the staticfiles directory under test root.
# Note: optimized files for testing are generated with settings from test_static_optimized
# Note: optimized files for testing are generated with settings from test_static_optimized
STATIC_URL
=
"/static/"
STATIC_URL
=
"/static/"
STATICFILES_FINDERS
=
(
STATICFILES_FINDERS
=
[
'django.contrib.staticfiles.finders.FileSystemFinder'
]
'django.contrib.staticfiles.finders.FileSystemFinder'
,
)
STATICFILES_DIRS
=
[
STATICFILES_DIRS
=
[
(
TEST_ROOT
/
"staticfiles"
/
"lms"
)
.
abspath
(),
(
TEST_ROOT
/
"staticfiles"
/
"lms"
)
.
abspath
(),
]
]
lms/envs/static.py
View file @
21791ccb
...
@@ -65,7 +65,7 @@ DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
...
@@ -65,7 +65,7 @@ DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
MEDIA_ROOT
=
ENV_ROOT
/
"uploads"
MEDIA_ROOT
=
ENV_ROOT
/
"uploads"
MEDIA_URL
=
"/discussion/upfiles/"
MEDIA_URL
=
"/discussion/upfiles/"
FILE_UPLOAD_TEMP_DIR
=
ENV_ROOT
/
"uploads"
FILE_UPLOAD_TEMP_DIR
=
ENV_ROOT
/
"uploads"
FILE_UPLOAD_HANDLERS
=
(
FILE_UPLOAD_HANDLERS
=
[
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
)
]
lms/envs/test.py
View file @
21791ccb
...
@@ -113,8 +113,8 @@ NOSE_PLUGINS = [
...
@@ -113,8 +113,8 @@ NOSE_PLUGINS = [
TEST_ROOT
=
path
(
"test_root"
)
TEST_ROOT
=
path
(
"test_root"
)
# Want static files in the same dir for running on jenkins.
# Want static files in the same dir for running on jenkins.
STATIC_ROOT
=
TEST_ROOT
/
"staticfiles"
STATIC_ROOT
=
TEST_ROOT
/
"staticfiles"
INSTALLED_APPS
=
tuple
(
app
for
app
in
INSTALLED_APPS
if
app
!=
'webpack_loader'
)
INSTALLED_APPS
=
[
app
for
app
in
INSTALLED_APPS
if
app
!=
'webpack_loader'
]
INSTALLED_APPS
+=
(
'openedx.tests.util.webpack_loader'
,
)
INSTALLED_APPS
.
append
(
'openedx.tests.util.webpack_loader'
)
WEBPACK_LOADER
[
'DEFAULT'
][
'STATS_FILE'
]
=
STATIC_ROOT
/
"webpack-stats.json"
WEBPACK_LOADER
[
'DEFAULT'
][
'STATS_FILE'
]
=
STATIC_ROOT
/
"webpack-stats.json"
STATUS_MESSAGE_PATH
=
TEST_ROOT
/
"status_message.json"
STATUS_MESSAGE_PATH
=
TEST_ROOT
/
"status_message.json"
...
@@ -208,7 +208,7 @@ if os.environ.get('DISABLE_MIGRATIONS'):
...
@@ -208,7 +208,7 @@ if os.environ.get('DISABLE_MIGRATIONS'):
# Make sure we test with the extended history table
# Make sure we test with the extended history table
FEATURES
[
'ENABLE_CSMH_EXTENDED'
]
=
True
FEATURES
[
'ENABLE_CSMH_EXTENDED'
]
=
True
INSTALLED_APPS
+=
(
'coursewarehistoryextended'
,
)
INSTALLED_APPS
.
append
(
'coursewarehistoryextended'
)
CACHES
=
{
CACHES
=
{
# This is the cache used for most things.
# This is the cache used for most things.
...
@@ -263,7 +263,7 @@ PASSWORD_COMPLEXITY = {}
...
@@ -263,7 +263,7 @@ PASSWORD_COMPLEXITY = {}
######### Third-party auth ##########
######### Third-party auth ##########
FEATURES
[
'ENABLE_THIRD_PARTY_AUTH'
]
=
True
FEATURES
[
'ENABLE_THIRD_PARTY_AUTH'
]
=
True
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'social_core.backends.google.GoogleOAuth2'
,
'social_core.backends.google.GoogleOAuth2'
,
'social_core.backends.linkedin.LinkedinOAuth2'
,
'social_core.backends.linkedin.LinkedinOAuth2'
,
'social_core.backends.facebook.FacebookOAuth2'
,
'social_core.backends.facebook.FacebookOAuth2'
,
...
@@ -272,7 +272,7 @@ AUTHENTICATION_BACKENDS = (
...
@@ -272,7 +272,7 @@ AUTHENTICATION_BACKENDS = (
'third_party_auth.dummy.DummyBackend'
,
'third_party_auth.dummy.DummyBackend'
,
'third_party_auth.saml.SAMLAuthBackend'
,
'third_party_auth.saml.SAMLAuthBackend'
,
'third_party_auth.lti.LTIAuthBackend'
,
'third_party_auth.lti.LTIAuthBackend'
,
)
+
AUTHENTICATION_BACKENDS
]
+
AUTHENTICATION_BACKENDS
THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS
=
{
THIRD_PARTY_AUTH_CUSTOM_AUTH_FORMS
=
{
'custom1'
:
{
'custom1'
:
{
...
@@ -390,10 +390,10 @@ for static_dir in STATICFILES_DIRS:
...
@@ -390,10 +390,10 @@ for static_dir in STATICFILES_DIRS:
STATICFILES_DIRS
=
_NEW_STATICFILES_DIRS
STATICFILES_DIRS
=
_NEW_STATICFILES_DIRS
FILE_UPLOAD_TEMP_DIR
=
TEST_ROOT
/
"uploads"
FILE_UPLOAD_TEMP_DIR
=
TEST_ROOT
/
"uploads"
FILE_UPLOAD_HANDLERS
=
(
FILE_UPLOAD_HANDLERS
=
[
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.MemoryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
'django.core.files.uploadhandler.TemporaryFileUploadHandler'
,
)
]
########################### Server Ports ###################################
########################### Server Ports ###################################
...
@@ -415,15 +415,10 @@ HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS = {
...
@@ -415,15 +415,10 @@ HOSTNAME_MODULESTORE_DEFAULT_MAPPINGS = {
################### Make tests faster
################### Make tests faster
#http://slacy.com/blog/2012/04/make-your-tests-faster-in-django-1-4/
PASSWORD_HASHERS
=
[
PASSWORD_HASHERS
=
(
# 'django.contrib.auth.hashers.PBKDF2PasswordHasher',
# 'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
# 'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.SHA1PasswordHasher'
,
'django.contrib.auth.hashers.SHA1PasswordHasher'
,
'django.contrib.auth.hashers.MD5PasswordHasher'
,
'django.contrib.auth.hashers.MD5PasswordHasher'
,
# 'django.contrib.auth.hashers.CryptPasswordHasher',
]
)
### This enables the Metrics tab for the Instructor dashboard ###########
### This enables the Metrics tab for the Instructor dashboard ###########
FEATURES
[
'CLASS_DASHBOARD'
]
=
True
FEATURES
[
'CLASS_DASHBOARD'
]
=
True
...
@@ -562,7 +557,7 @@ FACEBOOK_APP_ID = "Test"
...
@@ -562,7 +557,7 @@ FACEBOOK_APP_ID = "Test"
FACEBOOK_API_VERSION
=
"v2.8"
FACEBOOK_API_VERSION
=
"v2.8"
######### custom courses #########
######### custom courses #########
INSTALLED_APPS
+=
(
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
)
INSTALLED_APPS
+=
[
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
]
FEATURES
[
'CUSTOM_COURSES_EDX'
]
=
True
FEATURES
[
'CUSTOM_COURSES_EDX'
]
=
True
# Set dummy values for profile image settings.
# Set dummy values for profile image settings.
...
@@ -581,8 +576,8 @@ PROFILE_IMAGE_MIN_BYTES = 100
...
@@ -581,8 +576,8 @@ PROFILE_IMAGE_MIN_BYTES = 100
# Enable the LTI provider feature for testing
# Enable the LTI provider feature for testing
FEATURES
[
'ENABLE_LTI_PROVIDER'
]
=
True
FEATURES
[
'ENABLE_LTI_PROVIDER'
]
=
True
INSTALLED_APPS
+=
(
'lti_provider'
,
)
INSTALLED_APPS
.
append
(
'lti_provider'
)
AUTHENTICATION_BACKENDS
+=
(
'lti_provider.users.LtiBackend'
,
)
AUTHENTICATION_BACKENDS
.
append
(
'lti_provider.users.LtiBackend'
)
# ORGANIZATIONS
# ORGANIZATIONS
FEATURES
[
'ORGANIZATIONS_APP'
]
=
True
FEATURES
[
'ORGANIZATIONS_APP'
]
=
True
...
...
lms/envs/test_with_mysql.py
View file @
21791ccb
...
@@ -7,9 +7,9 @@ from .aws import * # pylint: disable=wildcard-import
...
@@ -7,9 +7,9 @@ from .aws import * # pylint: disable=wildcard-import
# Dummy secret key for dev
# Dummy secret key for dev
SECRET_KEY
=
'dev key'
SECRET_KEY
=
'dev key'
INSTALLED_APPS
=
(
INSTALLED_APPS
=
[
'django.contrib.auth'
,
'django.contrib.auth'
,
'django.contrib.contenttypes'
,
'django.contrib.contenttypes'
,
'lms.djangoapps.verify_student'
,
'lms.djangoapps.verify_student'
,
)
]
lms/envs/yaml_config.py
View file @
21791ccb
...
@@ -229,7 +229,7 @@ LANGUAGE_DICT = dict(LANGUAGES)
...
@@ -229,7 +229,7 @@ LANGUAGE_DICT = dict(LANGUAGES)
# Additional installed apps
# Additional installed apps
for
app
in
ADDL_INSTALLED_APPS
:
for
app
in
ADDL_INSTALLED_APPS
:
INSTALLED_APPS
+=
(
app
,
)
INSTALLED_APPS
.
append
(
app
)
LOGGING
=
get_logger_config
(
LOG_DIR
,
LOGGING
=
get_logger_config
(
LOG_DIR
,
logging_env
=
LOGGING_ENV
,
logging_env
=
LOGGING_ENV
,
...
@@ -247,12 +247,15 @@ for name, value in ENV_TOKENS.get("CODE_JAIL", {}).items():
...
@@ -247,12 +247,15 @@ for name, value in ENV_TOKENS.get("CODE_JAIL", {}).items():
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
if
FEATURES
.
get
(
'AUTH_USE_CAS'
):
AUTHENTICATION_BACKENDS
=
(
AUTHENTICATION_BACKENDS
=
[
'django.contrib.auth.backends.ModelBackend'
,
'django.contrib.auth.backends.ModelBackend'
,
'django_cas.backends.CASBackend'
,
'django_cas.backends.CASBackend'
,
)
]
INSTALLED_APPS
+=
(
'django_cas'
,)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
,)
INSTALLED_APPS
.
append
(
'django_cas'
)
MIDDLEWARE_CLASSES
.
append
(
'django_cas.middleware.CASMiddleware'
)
if
CAS_ATTRIBUTE_CALLBACK
:
if
CAS_ATTRIBUTE_CALLBACK
:
import
importlib
import
importlib
CAS_USER_DETAILS_RESOLVER
=
getattr
(
CAS_USER_DETAILS_RESOLVER
=
getattr
(
...
@@ -302,7 +305,7 @@ GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE
...
@@ -302,7 +305,7 @@ GRADES_DOWNLOAD_ROUTING_KEY = HIGH_MEM_QUEUE
##### Custom Courses for EdX #####
##### Custom Courses for EdX #####
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
if
FEATURES
.
get
(
'CUSTOM_COURSES_EDX'
):
INSTALLED_APPS
+=
(
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
)
INSTALLED_APPS
+=
[
'lms.djangoapps.ccx'
,
'openedx.core.djangoapps.ccxcon'
]
MODULESTORE_FIELD_OVERRIDE_PROVIDERS
+=
(
MODULESTORE_FIELD_OVERRIDE_PROVIDERS
+=
(
'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider'
,
'lms.djangoapps.ccx.overrides.CustomCoursesForEdxOverrideProvider'
,
)
)
...
@@ -315,8 +318,8 @@ if FEATURES.get('INDIVIDUAL_DUE_DATES'):
...
@@ -315,8 +318,8 @@ if FEATURES.get('INDIVIDUAL_DUE_DATES'):
##################### LTI Provider #####################
##################### LTI Provider #####################
if
FEATURES
.
get
(
'ENABLE_LTI_PROVIDER'
):
if
FEATURES
.
get
(
'ENABLE_LTI_PROVIDER'
):
INSTALLED_APPS
+=
(
'lti_provider'
,
)
INSTALLED_APPS
.
append
(
'lti_provider'
)
AUTHENTICATION_BACKENDS
+=
(
'lti_provider.users.LtiBackend'
,
)
AUTHENTICATION_BACKENDS
.
append
(
'lti_provider.users.LtiBackend'
)
################################ Settings for Credentials Service ################################
################################ Settings for Credentials Service ################################
...
...
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