blob: ce13f08be0077090929a0661da76e2e326682738 [file] [log] [blame]
Siobhan Tullybfd11dc2013-09-03 12:59:24 -04001from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
2
Tony Mack7130ac32013-03-22 21:58:00 -04003# Django settings for planetstack project.
Tony Macke485af32013-05-10 17:15:32 -04004from config import Config
5config = Config()
Scott Baker8a867eb2014-04-22 13:50:26 -07006
7GEOIP_PATH = "/usr/share/GeoIP"
Scott Baker40695e12014-03-13 22:50:45 -07008
Tony Mack7130ac32013-03-22 21:58:00 -04009DEBUG = True
10TEMPLATE_DEBUG = DEBUG
11
12ADMINS = (
13 # ('Your Name', 'your_email@example.com'),
14)
15
Siobhan Tullycf04fb62014-01-11 11:25:57 -050016LOGIN_REDIRECT_URL = '/admin/core/user'
17
Tony Mack7130ac32013-03-22 21:58:00 -040018MANAGERS = ADMINS
19
20DATABASES = {
21 'default': {
22 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
Tony Macke485af32013-05-10 17:15:32 -040023 'NAME': config.db_name, # Or path to database file if using sqlite3.
Tony Mack7130ac32013-03-22 21:58:00 -040024 # The following settings are not used with sqlite3:
Tony Macke485af32013-05-10 17:15:32 -040025 'USER': config.db_user,
26 'PASSWORD': config.db_password,
27 'HOST': config.db_host, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
Tony Mack7130ac32013-03-22 21:58:00 -040028 'PORT': '', # Set to empty string for default.
29 }
30}
31
Siobhan Tully30fd4292013-05-10 08:59:56 -040032AUTH_USER_MODEL = 'core.User'
33
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040034
Tony Mack7130ac32013-03-22 21:58:00 -040035# Hosts/domain names that are valid for this site; required if DEBUG is False
36# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
37ALLOWED_HOSTS = []
38
39# Local time zone for this installation. Choices can be found here:
40# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
41# although not all choices may be available on all operating systems.
42# In a Windows environment this must be set to your system time zone.
43TIME_ZONE = 'America/New_York'
44
45# Language code for this installation. All choices can be found here:
46# http://www.i18nguy.com/unicode/language-identifiers.html
47LANGUAGE_CODE = 'en-us'
48
49SITE_ID = 1
50
51# If you set this to False, Django will make some optimizations so as not
52# to load the internationalization machinery.
53USE_I18N = True
54
55# If you set this to False, Django will not format dates, numbers and
56# calendars according to the current locale.
57USE_L10N = True
58
59# If you set this to False, Django will not use timezone-aware datetimes.
60USE_TZ = True
61
62# Absolute filesystem path to the directory that will hold user-uploaded files.
63# Example: "/var/www/example.com/media/"
Scott Baker40695e12014-03-13 22:50:45 -070064MEDIA_ROOT = '/var/www/html/files/'
Tony Mack7130ac32013-03-22 21:58:00 -040065
66# URL that handles the media served from MEDIA_ROOT. Make sure to use a
67# trailing slash.
68# Examples: "http://example.com/media/", "http://media.example.com/"
Scott Baker40695e12014-03-13 22:50:45 -070069MEDIA_URL = '/files/'
Tony Mack7130ac32013-03-22 21:58:00 -040070
71# Absolute path to the directory static files should be collected to.
72# Don't put anything in this directory yourself; store your static files
73# in apps' "static/" subdirectories and in STATICFILES_DIRS.
74# Example: "/var/www/example.com/static/"
75STATIC_ROOT = ''
76
77# URL prefix for static files.
78# Example: "http://example.com/static/", "http://static.example.com/"
79STATIC_URL = '/static/'
80
81# Additional locations of static files
Siobhan Tullybfd11dc2013-09-03 12:59:24 -040082STATICFILES_DIRS = ( "/opt/planetstack/core/static/",
Tony Mack7130ac32013-03-22 21:58:00 -040083 # Put strings here, like "/home/html/static" or "C:/www/django/static".
84 # Always use forward slashes, even on Windows.
85 # Don't forget to use absolute paths, not relative paths.
86)
87
88# List of finder classes that know how to find static files in
89# various locations.
90STATICFILES_FINDERS = (
91 'django.contrib.staticfiles.finders.FileSystemFinder',
92 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
93# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
94)
95
96# Make this unique, and don't share it with anybody.
97SECRET_KEY = 'i0=a)c7_#2)5m%k_fu#%53xap$tlqc+#&z5as+bl7&)(@be_f9'
98
99# List of callables that know how to import templates from various sources.
100TEMPLATE_LOADERS = (
101 'django.template.loaders.filesystem.Loader',
102 'django.template.loaders.app_directories.Loader',
103# 'django.template.loaders.eggs.Loader',
104)
105
106MIDDLEWARE_CLASSES = (
107 'django.middleware.common.CommonMiddleware',
108 'django.contrib.sessions.middleware.SessionMiddleware',
109 'django.middleware.csrf.CsrfViewMiddleware',
110 'django.contrib.auth.middleware.AuthenticationMiddleware',
111 'django.contrib.messages.middleware.MessageMiddleware',
112 # Uncomment the next line for simple clickjacking protection:
113 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
114)
115
Siobhan Tully30fd4292013-05-10 08:59:56 -0400116ROOT_URLCONF = 'planetstack.urls'
Tony Mack7130ac32013-03-22 21:58:00 -0400117
118# Python dotted path to the WSGI application used by Django's runserver.
Siobhan Tully30fd4292013-05-10 08:59:56 -0400119WSGI_APPLICATION = 'planetstack.wsgi.application'
Tony Mack7130ac32013-03-22 21:58:00 -0400120
121TEMPLATE_DIRS = (
122 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
123 # Always use forward slashes, even on Windows.
124 # Don't forget to use absolute paths, not relative paths.
Siobhan Tully30fd4292013-05-10 08:59:56 -0400125 "/opt/planetstack/templates"
Tony Mack7130ac32013-03-22 21:58:00 -0400126)
127
128INSTALLED_APPS = (
129 'django.contrib.auth',
130 'django.contrib.contenttypes',
131 'django.contrib.sessions',
132# 'django.contrib.sites',
133 'django.contrib.messages',
134 'django.contrib.staticfiles',
135 # Uncomment the next line to enable the admin:
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400136 'suit',
Tony Mack7130ac32013-03-22 21:58:00 -0400137 'django.contrib.admin',
138 # Uncomment the next line to enable admin documentation:
139 'django.contrib.admindocs',
140 'rest_framework',
141 'django_extensions',
Tony Mack7130ac32013-03-22 21:58:00 -0400142 'django_evolution',
Siobhan Tullybf1153a2013-05-27 20:53:48 -0400143 'core',
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400144 'hpc',
Siobhan Tullyce652d02013-10-08 21:52:35 -0400145 'requestrouter',
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500146 'syndicate',
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400147 'geoposition',
Tony Mack7130ac32013-03-22 21:58:00 -0400148)
149
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400150
151# Added for django-suit form
152TEMPLATE_CONTEXT_PROCESSORS = TCP + (
153 'django.core.context_processors.request',
154)
155
156# Django Suit configuration example
157SUIT_CONFIG = {
158 # header
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500159 'ADMIN_NAME': 'OpenCloud',
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400160 # 'HEADER_DATE_FORMAT': 'l, j. F Y',
161 # 'HEADER_TIME_FORMAT': 'H:i',
162
163 # forms
164 #'SHOW_REQUIRED_ASTERISK': True, # Default True
165 'CONFIRM_UNSAVED_CHANGES': True, # Default True
166
167 # menu
168 # 'SEARCH_URL': '/admin/auth/user/',
169 # 'MENU_ICONS': {
170 # 'sites': 'icon-leaf',
171 # 'auth': 'icon-lock',
172 # },
173 # 'MENU_OPEN_FIRST_CHILD': True, # Default True
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500174 'MENU_EXCLUDE': (
175 'auth.group',
176 'auth',
177 'core.network',
178 'core.sliver',
179 'core.node',
180 'core.image',
181 'core.deploymentrole',
182 'core.siterole',
183 'core.slicerole',
184 'core.planetstackrole',
185 'core.networktemplate',
186 'core.networkparametertype',
187 'core.router',
188 'core.tag',
189 'core.account',
190 'core.invoice',
191 'core.serviceclass',
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400192 ),
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500193 'MENU': (
194 #{'app': 'core', 'icon':'icon-lock'},
195 #{'app': 'core', 'icon': 'icon-lock', 'models': ('core.site', 'core.deployment', 'core.service', 'core.slice', 'core.user', 'core.reservation', 'core.account', 'core.invoice', 'core.payment', 'core.usableobject')},
196 {'label': 'Deployments', 'icon':'icon-deployment', 'url': '/admin/core/deployment/'},
197 {'label': 'Sites', 'icon':'icon-site', 'url': '/admin/core/site/'},
198 {'label': 'Slices', 'icon':'icon-slice', 'url': '/admin/core/slice/'},
199 {'label': 'Users', 'icon':'icon-user', 'url': '/admin/core/user/'},
200 {'label': 'Request Routing', 'icon':'icon-cog', 'app': 'requestrouter'},
201 {'label': 'HyperCache', 'icon':'icon-cog', 'app': 'hpc'},
202 {'label': 'Syndicate', 'icon':'icon-cog', 'app': 'syndicate'},
203 #{'label': 'Configured Services', 'icon':'icon-cog', 'models': [{'label': 'Content Delivery Network', 'app':'hpc'}]},
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400204 # 'sites',
205 # {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400206 # {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500207 # {'label': 'Settings', 'icon':'icon-cog', 'models': ('core.user', 'core.site')},
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400208 # ),
Siobhan Tullycf04fb62014-01-11 11:25:57 -0500209 ),
Siobhan Tullybfd11dc2013-09-03 12:59:24 -0400210
211 # misc
212 # 'LIST_PER_PAGE': 15
213}
214
Tony Mack7130ac32013-03-22 21:58:00 -0400215# A sample logging configuration. The only tangible logging
216# performed by this configuration is to send an email to
217# the site admins on every HTTP 500 error when DEBUG=False.
218# See http://docs.djangoproject.com/en/dev/topics/logging for
219# more details on how to customize your logging configuration.
220LOGGING = {
221 'version': 1,
222 'disable_existing_loggers': False,
223 'filters': {
224 'require_debug_false': {
225 '()': 'django.utils.log.RequireDebugFalse'
226 }
227 },
228 'handlers': {
229 'mail_admins': {
230 'level': 'ERROR',
231 'filters': ['require_debug_false'],
232 'class': 'django.utils.log.AdminEmailHandler'
233 }
234 },
235 'loggers': {
236 'django.request': {
237 'handlers': ['mail_admins'],
238 'level': 'ERROR',
239 'propagate': True,
240 },
241 }
242}
Scott Bakerc40941b2014-04-25 12:20:47 -0700243
244BIGQUERY_TABLE = getattr(config, "bigquery_table", "demoevents")