forked from nprapps/app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app_config.py
69 lines (53 loc) · 1.57 KB
/
app_config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env python
"""
Project-wide application configuration.
DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE.
They will be exposed to users. Use environment variables instead.
"""
import os
PROJECT_NAME = 'App Template'
DEPLOYED_NAME = 'app-template'
REPOSITORY_NAME = 'app-template'
PRODUCTION_S3_BUCKETS = ['apps.npr.org', 'apps2.npr.org']
PRODUCTION_SERVERS = ['cron.nprapps.org']
STAGING_S3_BUCKETS = ['stage-apps.npr.org']
STAGING_SERVERS = ['cron-staging.nprapps.org']
S3_BUCKETS = []
SERVERS = []
DEBUG = True
PROJECT_DESCRIPTION = 'An opinionated project template for client-side apps.'
SHARE_URL = 'http://%s/%s/' % (PRODUCTION_S3_BUCKETS[0], DEPLOYED_NAME)
TWITTER = {
'TEXT': PROJECT_NAME,
'URL': SHARE_URL
}
FACEBOOK = {
'TITLE': PROJECT_NAME,
'URL': SHARE_URL,
'DESCRIPTION': PROJECT_DESCRIPTION,
'IMAGE_URL': '',
'APP_ID': '138837436154588'
}
NPR_DFP = {
'STORY_ID': '171421875',
'TARGET': '\/news_politics;storyid=171421875'
}
GOOGLE_ANALYTICS_ID = 'UA-5828686-4'
def configure_targets(deployment_target):
"""
Configure deployment targets. Abstracted so this can be
overriden for rendering before deployment.
"""
global S3_BUCKETS
global SERVERS
global DEBUG
if deployment_target == 'production':
S3_BUCKETS = PRODUCTION_S3_BUCKETS
SERVERS = PRODUCTION_SERVERS
DEBUG = False
else:
S3_BUCKETS = STAGING_S3_BUCKETS
SERVERS = STAGING_SERVERS
DEBUG = True
DEPLOYMENT_TARGET = os.environ.get('DEPLOYMENT_TARGET', None)
configure_targets(DEPLOYMENT_TARGET)