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
ab6ec55a
Commit
ab6ec55a
authored
Apr 03, 2012
by
David Ormsbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert AWS settings to pull values from JSON files
parent
d7131c8b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
9 deletions
+59
-9
envs/aws.py
+59
-5
envs/common.py
+0
-4
No files found.
envs/aws.py
View file @
ab6ec55a
"""
This is the default template for our main set of AWS servers. This does NOT
cover the content machines, which use content.py
Common traits:
* Use memcached, and cache-backed sessions
* Use a MySQL 5.1 database
"""
import
json
from
common
import
*
############################### ALWAYS THE SAME ################################
DEBUG
=
False
TEMPLATE_DEBUG
=
False
EMAIL_BACKEND
=
'django_ses.SESBackend'
SESSION_ENGINE
=
'django.contrib.sessions.backends.cache'
DEFAULT_FILE_STORAGE
=
'storages.backends.s3boto.S3BotoStorage'
CSRF_COOKIE_DOMAIN
=
'.mitx.mit.edu'
LIB_URL
=
'https://mitxstatic.s3.amazonaws.com/js/'
BOOK_URL
=
'https://mitxstatic.s3.amazonaws.com/book_images/'
########################### NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
with
open
(
BASE_DIR
/
"env.json"
)
as
env_file
:
ENV_TOKENS
=
json
.
load
(
env_file
)
SITE_NAME
=
ENV_TOKENS
[
'SITE_NAME'
]
# "extstage.mitx.mit.edu"
CSRF_COOKIE_DOMAIN
=
ENV_TOKENS
[
'CSRF_COOKIE_DOMAIN'
]
# '.mitx.mit.edu'
BOOK_URL
=
ENV_TOKENS
[
'BOOK_URL'
]
# 'https://mitxstatic.s3.amazonaws.com/book_images/'
LIB_URL
=
ENV_TOKENS
[
'LIB_URL'
]
# 'https://mitxstatic.s3.amazonaws.com/js/'
MEDIA_URL
=
ENV_TOKENS
[
'MEDIA_URL'
]
# 'http://s3.amazonaws.com/mitx_askbot_stage/'
LOG_DIR
=
ENV_TOKENS
[
'LOG_DIR'
]
# "/mnt/logs/"
CACHES
=
{
'default'
:
{
...
...
@@ -14,5 +38,34 @@ CACHES = {
}
}
DEBUG
=
False
TEMPLATE_DEBUG
=
False
CACHES
=
{
'default'
:
{
'BACKEND'
:
'django.core.cache.backends.memcached.MemcachedCache'
,
'LOCATION'
:
'127.0.0.1:11211'
,
},
'general'
:
{
'BACKEND'
:
'django.core.cache.backends.memcached.MemcachedCache'
,
'LOCATION'
:
'127.0.0.1:11211'
,
'KEY_PREFIX'
:
'general'
,
'VERSION'
:
5
,
}
}
############################## SECURE AUTH ITEMS ###############################
# Secret things: passwords, access keys, etc.
with
open
(
BASE_DIR
/
"auth.json"
)
as
auth_file
:
AUTH_TOKENS
=
json
.
load
(
auth_file
)
AWS_ACCESS_KEY_ID
=
AUTH_TOKENS
[
"AWS_ACCESS_KEY_ID"
]
AWS_SECRET_ACCESS_KEY
=
AUTH_TOKENS
[
"AWS_SECRET_ACCESS_KEY"
]
DATABASES
=
{
'default'
:
{
'ENGINE'
:
'django.db.backends.mysql'
,
'NAME'
:
'wwc'
,
'USER'
:
'root'
,
'PASSWORD'
:
authtokens
[
"PASSWORD"
],
'HOST'
:
'***REMOVED***'
,
'PORT'
:
'3306'
,
}
}
\ No newline at end of file
envs/common.py
View file @
ab6ec55a
...
...
@@ -10,10 +10,6 @@ We should make a method that calls all these config methods so that you just
make one call at the end of your site-specific dev file to reset all the
dependent variables (like INSTALLED_APPS) for you.
IMMEDIATE TODO:
1. Fix logging()
2.
Longer TODO:
1. Right now our treatment of static content in general and in particular
course-specific static content is haphazard.
...
...
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