Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
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-analytics-data-api
Commits
788a7067
Commit
788a7067
authored
Jun 23, 2014
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating production settings to read in everything from a yaml file
parent
68e27ba8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
48 deletions
+8
-48
analyticsdataserver/settings/production.py
+5
-48
requirements/base.txt
+1
-0
requirements/production.txt
+2
-0
No files found.
analyticsdataserver/settings/production.py
View file @
788a7067
...
...
@@ -2,8 +2,8 @@
from
os
import
environ
from
base
import
*
import
yaml
# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
...
...
@@ -23,53 +23,10 @@ def get_env_setting(setting):
ALLOWED_HOSTS
=
[
'*'
]
########## END HOST CONFIGURATION
########## EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND
=
'django.core.mail.backends.smtp.EmailBackend'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
EMAIL_HOST
=
environ
.
get
(
'EMAIL_HOST'
,
'smtp.gmail.com'
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
EMAIL_HOST_PASSWORD
=
environ
.
get
(
'EMAIL_HOST_PASSWORD'
,
''
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
EMAIL_HOST_USER
=
environ
.
get
(
'EMAIL_HOST_USER'
,
'your_email@example.com'
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT
=
environ
.
get
(
'EMAIL_PORT'
,
587
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX
=
'[
%
s] '
%
SITE_NAME
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS
=
True
# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL
=
EMAIL_HOST_USER
########## END EMAIL CONFIGURATION
########## DATABASE CONFIGURATION
DATABASES
=
{
'default'
:
{
'ENGINE'
:
environ
.
get
(
'DATABASE_ENGINE'
,
'django.db.backends.mysql'
),
'NAME'
:
get_env_setting
(
'DATABASE_NAME'
),
'USER'
:
get_env_setting
(
'DATABASE_USER'
),
'PASSWORD'
:
get_env_setting
(
'DATABASE_PASSWORD'
),
'HOST'
:
environ
.
get
(
'DATABASE_HOST'
,
'localhost'
),
'PORT'
:
environ
.
get
(
'DATABASE_PORT'
,
'3306'
),
}
}
########## END DATABASE CONFIGURATION
CONFIG_FILE
=
get_env_setting
(
'ANALYTICS_API_CFG'
)
########## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES
=
{}
########## END CACHE CONFIGURATION
with
open
(
CONFIG_FILE
)
as
f
:
config_from_yaml
=
yaml
.
load
(
f
)
vars
()
.
update
(
config_from_yaml
)
########## SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY
=
get_env_setting
(
'SECRET_KEY'
)
########## END SECRET CONFIGURATION
requirements/base.txt
View file @
788a7067
...
...
@@ -3,3 +3,4 @@ django-model-utils==1.4.0
South==0.8.1
djangorestframework==2.3.5
Markdown==2.4.1
ipython==2.1.0
requirements/production.txt
View file @
788a7067
...
...
@@ -4,3 +4,5 @@
gunicorn==0.17.4
MySQL-python==1.2.5
path.py==5.2
PyYAML==3.11
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