1 from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
3 # Django settings for planetstack project.
4 from config import Config
7 GEOIP_PATH = "/usr/share/GeoIP"
10 TEMPLATE_DEBUG = DEBUG
13 # ('Your Name', 'your_email@example.com'),
16 LOGIN_REDIRECT_URL = '/admin/core/user'
22 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
23 'NAME': config.db_name, # Or path to database file if using sqlite3.
24 # The following settings are not used with sqlite3:
25 '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.
28 'PORT': '', # Set to empty string for default.
32 AUTH_USER_MODEL = 'core.User'
35 # 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
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.
43 TIME_ZONE = 'America/New_York'
45 # Language code for this installation. All choices can be found here:
46 # http://www.i18nguy.com/unicode/language-identifiers.html
47 LANGUAGE_CODE = 'en-us'
51 # If you set this to False, Django will make some optimizations so as not
52 # to load the internationalization machinery.
55 # If you set this to False, Django will not format dates, numbers and
56 # calendars according to the current locale.
59 # If you set this to False, Django will not use timezone-aware datetimes.
62 # Absolute filesystem path to the directory that will hold user-uploaded files.
63 # Example: "/var/www/example.com/media/"
64 MEDIA_ROOT = '/var/www/html/files/'
66 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
68 # Examples: "http://example.com/media/", "http://media.example.com/"
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/"
77 # URL prefix for static files.
78 # Example: "http://example.com/static/", "http://static.example.com/"
79 STATIC_URL = '/static/'
81 # Additional locations of static files
82 STATICFILES_DIRS = ( "/opt/planetstack/core/static/",
83 # 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.
88 # List of finder classes that know how to find static files in
90 STATICFILES_FINDERS = (
91 'django.contrib.staticfiles.finders.FileSystemFinder',
92 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
93 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
96 # Make this unique, and don't share it with anybody.
97 SECRET_KEY = 'i0=a)c7_#2)5m%k_fu#%53xap$tlqc+#&z5as+bl7&)(@be_f9'
99 # List of callables that know how to import templates from various sources.
101 'django.template.loaders.filesystem.Loader',
102 'django.template.loaders.app_directories.Loader',
103 # 'django.template.loaders.eggs.Loader',
106 MIDDLEWARE_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',
116 ROOT_URLCONF = 'planetstack.urls'
118 # Python dotted path to the WSGI application used by Django's runserver.
119 WSGI_APPLICATION = 'planetstack.wsgi.application'
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.
125 "/opt/planetstack/templates"
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:
137 'django.contrib.admin',
138 # Uncomment the next line to enable admin documentation:
139 'django.contrib.admindocs',
154 # Added for django-suit form
155 TEMPLATE_CONTEXT_PROCESSORS = TCP + (
156 'django.core.context_processors.request',
157 'core.context_processors.planetstack',
160 # Django Suit configuration example
163 'ADMIN_NAME': 'OpenCloud',
164 # 'HEADER_DATE_FORMAT': 'l, j. F Y',
165 # 'HEADER_TIME_FORMAT': 'H:i',
168 #'SHOW_REQUIRED_ASTERISK': True, # Default True
169 'CONFIRM_UNSAVED_CHANGES': True, # Default True
172 # 'SEARCH_URL': '/admin/auth/user/',
174 # 'sites': 'icon-leaf',
175 # 'auth': 'icon-lock',
177 # 'MENU_OPEN_FIRST_CHILD': True, # Default True
185 'core.deploymentrole',
188 'core.planetstackrole',
189 'core.networktemplate',
190 'core.networkparametertype',
198 #{'app': 'core', 'icon':'icon-lock'},
199 #{'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')},
200 {'label': 'Deployments', 'icon':'icon-deployment', 'url': '/admin/core/deployment/'},
201 {'label': 'Sites', 'icon':'icon-site', 'url': '/admin/core/site/'},
202 {'label': 'Slices', 'icon':'icon-slice', 'url': '/admin/core/slice/'},
203 {'label': 'Users', 'icon':'icon-user', 'url': '/admin/core/user/'},
204 {'label': 'RequestRouter', 'icon':'icon-cog', 'app': 'requestrouter'},
205 {'label': 'HyperCache', 'icon':'icon-cog', 'app': 'hpc'},
206 {'label': 'Syndicate', 'icon':'icon-cog', 'app': 'syndicate'},
207 {'label': 'Cassandra', 'icon':'icon-cog', 'app': 'cassandra'},
208 # {'label': 'KairosDB', 'icon':'icon-cog', 'app': 'kairos'},
209 # {'label': 'Nagios', 'icon':'icon-cog', 'app': 'nagios'},
211 #{'label': 'Configured Services', 'icon':'icon-cog', 'models': [{'label': 'Content Delivery Network', 'app':'hpc'}]},
213 # {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
214 # {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
215 # {'label': 'Settings', 'icon':'icon-cog', 'models': ('core.user', 'core.site')},
220 # 'LIST_PER_PAGE': 15
223 # A sample logging configuration. The only tangible logging
224 # performed by this configuration is to send an email to
225 # the site admins on every HTTP 500 error when DEBUG=False.
226 # See http://docs.djangoproject.com/en/dev/topics/logging for
227 # more details on how to customize your logging configuration.
230 'disable_existing_loggers': False,
232 'require_debug_false': {
233 '()': 'django.utils.log.RequireDebugFalse'
239 'filters': ['require_debug_false'],
240 'class': 'django.utils.log.AdminEmailHandler'
245 'handlers': ['mail_admins'],
252 BIGQUERY_TABLE = getattr(config, "bigquery_table", "demoevents")
254 DISABLE_MINIDASHBOARD = getattr(config, "gui_disable_minidashboard", False)