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
ab146154
Commit
ab146154
authored
Aug 01, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved CSRF override into its own settings file
parent
39030c66
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
35 deletions
+12
-35
cms/envs/aws.py
+0
-8
cms/envs/dev.py
+0
-9
lms/envs/aws.py
+1
-9
lms/envs/dev.py
+0
-9
lms/envs/load_test.py
+11
-0
No files found.
cms/envs/aws.py
View file @
ab146154
...
...
@@ -126,14 +126,6 @@ LOGGING = get_logger_config(LOG_DIR,
#theming start:
PLATFORM_NAME
=
ENV_TOKENS
.
get
(
'PLATFORM_NAME'
,
'edX'
)
# Disable CSRF for load testing
if
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
):
exclude_csrf
=
lambda
elem
:
not
elem
in
\
[
'django.core.context_processors.csrf'
,
'django.middleware.csrf.CsrfViewMiddleware'
]
TEMPLATE_CONTEXT_PROCESSORS
=
filter
(
exclude_csrf
,
TEMPLATE_CONTEXT_PROCESSORS
)
MIDDLEWARE_CLASSES
=
filter
(
exclude_csrf
,
MIDDLEWARE_CLASSES
)
################ SECURE AUTH ITEMS ###############################
# Secret things: passwords, access keys, etc.
...
...
cms/envs/dev.py
View file @
ab146154
...
...
@@ -182,15 +182,6 @@ SEGMENT_IO_KEY = os.environ.get('SEGMENT_IO_KEY')
if
SEGMENT_IO_KEY
:
MITX_FEATURES
[
'SEGMENT_IO'
]
=
True
########################## LOAD TESTING ########################
# Disable CSRF for load testing
if
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
):
exclude_csrf
=
lambda
elem
:
not
elem
in
\
[
'django.core.context_processors.csrf'
,
'django.middleware.csrf.CsrfViewMiddleware'
]
TEMPLATE_CONTEXT_PROCESSORS
=
filter
(
exclude_csrf
,
TEMPLATE_CONTEXT_PROCESSORS
)
MIDDLEWARE_CLASSES
=
filter
(
exclude_csrf
,
MIDDLEWARE_CLASSES
)
#####################################################################
# Lastly, see if the developer has any local overrides.
...
...
lms/envs/aws.py
View file @
ab146154
...
...
@@ -10,6 +10,7 @@ Common traits:
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
import
json
from
.common
import
*
...
...
@@ -177,15 +178,6 @@ for name, value in ENV_TOKENS.get("CODE_JAIL", {}).items():
COURSES_WITH_UNSAFE_CODE
=
ENV_TOKENS
.
get
(
"COURSES_WITH_UNSAFE_CODE"
,
[])
# Disable CSRF for load testing
if
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
):
exclude_csrf
=
lambda
elem
:
not
elem
in
\
[
'django.core.context_processors.csrf'
,
'django.middleware.csrf.CsrfViewMiddleware'
]
TEMPLATE_CONTEXT_PROCESSORS
=
filter
(
exclude_csrf
,
TEMPLATE_CONTEXT_PROCESSORS
)
MIDDLEWARE_CLASSES
=
filter
(
exclude_csrf
,
MIDDLEWARE_CLASSES
)
############################## SECURE AUTH ITEMS ###############
# Secret things: passwords, access keys, etc.
...
...
lms/envs/dev.py
View file @
ab146154
...
...
@@ -255,15 +255,6 @@ SEGMENT_IO_LMS_KEY = os.environ.get('SEGMENT_IO_LMS_KEY')
if
SEGMENT_IO_LMS_KEY
:
MITX_FEATURES
[
'SEGMENT_IO_LMS'
]
=
True
########################## LOAD TESTING ########################
# Disable CSRF for load testing
if
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
):
exclude_csrf
=
lambda
elem
:
not
elem
in
\
[
'django.core.context_processors.csrf'
,
'django.middleware.csrf.CsrfViewMiddleware'
]
TEMPLATE_CONTEXT_PROCESSORS
=
filter
(
exclude_csrf
,
TEMPLATE_CONTEXT_PROCESSORS
)
MIDDLEWARE_CLASSES
=
filter
(
exclude_csrf
,
MIDDLEWARE_CLASSES
)
########################## USER API ########################
EDX_API_KEY
=
None
...
...
lms/envs/load_test.py
0 → 100644
View file @
ab146154
# Settings for load testing
from
.aws
import
*
# Disable CSRF for load testing
if
MITX_FEATURES
.
get
(
'AUTOMATIC_AUTH_FOR_LOAD_TESTING'
):
exclude_csrf
=
lambda
elem
:
not
elem
in
\
[
'django.core.context_processors.csrf'
,
'django.middleware.csrf.CsrfViewMiddleware'
]
TEMPLATE_CONTEXT_PROCESSORS
=
filter
(
exclude_csrf
,
TEMPLATE_CONTEXT_PROCESSORS
)
MIDDLEWARE_CLASSES
=
filter
(
exclude_csrf
,
MIDDLEWARE_CLASSES
)
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