Skip to content

Commit 545140d

Browse files
committed
Started moving app-specific settings into app settings.py files.
- Legacy-Id: 11949
1 parent 67415af commit 545140d

2 files changed

Lines changed: 110 additions & 103 deletions

File tree

ietf/doc/settings.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
CHART_TYPE_COLUMN_OPTIONS = {
2+
"chart": {
3+
"type": 'column',
4+
},
5+
"credits": {
6+
"enabled": False,
7+
},
8+
"exporting": {
9+
"fallbackToExportServer": False,
10+
},
11+
"rangeSelector" : {
12+
"selected": 5,
13+
"allButtonsEnabled": True,
14+
},
15+
"series" : [{
16+
"name" : "Items",
17+
"type" : "column",
18+
"data" : [],
19+
"dataGrouping": {
20+
"units": [[
21+
'week', # unit name
22+
[1,], # allowed multiples
23+
], [
24+
'month',
25+
[1, 4,],
26+
]]
27+
},
28+
"turboThreshold": 1, # Only check format of first data point. All others are the same
29+
"pointIntervalUnit": 'day',
30+
"pointPadding": 0.05,
31+
}],
32+
"title" : {
33+
"text" : "Items over time"
34+
},
35+
"xAxis": {
36+
"type": "datetime",
37+
# This makes the axis use the given coordinates, rather than
38+
# squashing them to equidistant columns
39+
"ordinal": False,
40+
},
41+
}
42+
43+
CHART_TYPE_ACTIVITY_OPTIONS = {
44+
"chart": {
45+
"type": 'column',
46+
},
47+
"credits": {
48+
"enabled": False,
49+
},
50+
"exporting": {
51+
"fallbackToExportServer": False,
52+
},
53+
"navigation": {
54+
"buttonOptions": {
55+
"enabled": False,
56+
}
57+
},
58+
"navigator": {
59+
"enabled": False,
60+
},
61+
"rangeSelector" : {
62+
"enabled": False,
63+
},
64+
"scrollbar": {
65+
"enabled": False,
66+
},
67+
"series" : [{
68+
"name" : None,
69+
"animation": False,
70+
"type" : "column",
71+
"data" : [],
72+
"dataGrouping": {
73+
"units": [[
74+
'year', # unit name
75+
[1,], # allowed multiples
76+
]]
77+
},
78+
"turboThreshold": 1, # Only check format of first data point. All others are the same
79+
"pointIntervalUnit": 'day',
80+
"pointPadding": -0.2,
81+
}],
82+
"title" : {
83+
"text" : None,
84+
},
85+
"xAxis": {
86+
"type": "datetime",
87+
# This makes the axis use the given coordinates, rather than
88+
# squashing them to equidistant columns
89+
"ordinal": False,
90+
},
91+
"yAxis": {
92+
"labels": {
93+
"enabled": False,
94+
}
95+
},
96+
}
97+

ietf/settings.py

Lines changed: 13 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,25 @@
55
# http://code.djangoproject.com/wiki/SplitSettings
66

77
import os
8+
import importlib
9+
import sys
10+
import datetime
11+
812
try:
913
import syslog
1014
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
1115
except ImportError:
1216
pass
1317

1418
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
15-
16-
# a place to put ajax logs if necessary.
17-
LOG_DIR = '/var/log/datatracker'
18-
19-
import sys
2019
sys.path.append(os.path.abspath(BASE_DIR + "/.."))
2120

22-
import datetime
23-
2421
from ietf import __version__
22+
import debug
2523

2624
DEBUG = True
2725
TEMPLATE_DEBUG = DEBUG
26+
debug.debug = DEBUG
2827

2928
# Valid values:
3029
# 'production', 'test', 'development'
@@ -693,108 +692,18 @@ def skip_unreadable_post(record):
693692
LIST_ACCOUNT_DELAY = 60*60*25 # 25 hours
694693
ACCOUNT_REQUEST_EMAIL = 'account-request@ietf.org'
695694

696-
CHART_TYPE_COLUMN_OPTIONS = {
697-
"chart": {
698-
"type": 'column',
699-
},
700-
"credits": {
701-
"enabled": False,
702-
},
703-
"exporting": {
704-
"fallbackToExportServer": False,
705-
},
706-
"rangeSelector" : {
707-
"selected": 5,
708-
"allButtonsEnabled": True,
709-
},
710-
"series" : [{
711-
"name" : "Items",
712-
"type" : "column",
713-
"data" : [],
714-
"dataGrouping": {
715-
"units": [[
716-
'week', # unit name
717-
[1,], # allowed multiples
718-
], [
719-
'month',
720-
[1, 4,],
721-
]]
722-
},
723-
"turboThreshold": 1, # Only check format of first data point. All others are the same
724-
"pointIntervalUnit": 'day',
725-
"pointPadding": 0.05,
726-
}],
727-
"title" : {
728-
"text" : "Items over time"
729-
},
730-
"xAxis": {
731-
"type": "datetime",
732-
# This makes the axis use the given coordinates, rather than
733-
# squashing them to equidistant columns
734-
"ordinal": False,
735-
},
736-
}
737-
738-
CHART_TYPE_ACTIVITY_OPTIONS = {
739-
"chart": {
740-
"type": 'column',
741-
},
742-
"credits": {
743-
"enabled": False,
744-
},
745-
"exporting": {
746-
"fallbackToExportServer": False,
747-
},
748-
"navigation": {
749-
"buttonOptions": {
750-
"enabled": False,
751-
}
752-
},
753-
"navigator": {
754-
"enabled": False,
755-
},
756-
"rangeSelector" : {
757-
"enabled": False,
758-
},
759-
"scrollbar": {
760-
"enabled": False,
761-
},
762-
"series" : [{
763-
"name" : None,
764-
"animation": False,
765-
"type" : "column",
766-
"data" : [],
767-
"dataGrouping": {
768-
"units": [[
769-
'year', # unit name
770-
[1,], # allowed multiples
771-
]]
772-
},
773-
"turboThreshold": 1, # Only check format of first data point. All others are the same
774-
"pointIntervalUnit": 'day',
775-
"pointPadding": -0.2,
776-
}],
777-
"title" : {
778-
"text" : None,
779-
},
780-
"xAxis": {
781-
"type": "datetime",
782-
# This makes the axis use the given coordinates, rather than
783-
# squashing them to equidistant columns
784-
"ordinal": False,
785-
},
786-
"yAxis": {
787-
"labels": {
788-
"enabled": False,
789-
}
790-
},
791-
}
792695

793696

794697
# Put the production SECRET_KEY in settings_local.py, and also any other
795698
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
796699
from settings_local import * # pyflakes:ignore pylint: disable=wildcard-import
797700

701+
for app in INSTALLED_APPS:
702+
if app.startswith('ietf'):
703+
app_settings_file = os.path.join(app.replace('.', os.sep), "settings.py")
704+
if os.path.exists(app_settings_file):
705+
exec "from %s import *" % (app+".settings")
706+
798707
# Add DEV_APPS to INSTALLED_APPS
799708
INSTALLED_APPS += DEV_APPS
800709
MIDDLEWARE_CLASSES += DEV_MIDDLEWARE_CLASSES
@@ -817,5 +726,6 @@ def skip_unreadable_post(record):
817726

818727
if 'SECRET_KEY' not in locals():
819728
SECRET_KEY = 'PDwXboUq!=hPjnrtG2=ge#N$Dwy+wn@uivrugwpic8mxyPfHka'
729+
820730
ALLOWED_HOSTS = ['*',]
821731

0 commit comments

Comments
 (0)