1 from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
3 # Django settings for planetstack project.
4 from config import Config
11 # ('Your Name', 'your_email@example.com'),
14 LOGIN_REDIRECT_URL = '/admin/core/user'
20 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
21 'NAME': config.db_name, # Or path to database file if using sqlite3.
22 # The following settings are not used with sqlite3:
23 'USER': config.db_user,
24 'PASSWORD': config.db_password,
25 'HOST': config.db_host, # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
26 'PORT': '', # Set to empty string for default.
30 AUTH_USER_MODEL = 'core.User'
33 # Hosts/domain names that are valid for this site; required if DEBUG is False
34 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
37 # Local time zone for this installation. Choices can be found here:
38 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39 # although not all choices may be available on all operating systems.
40 # In a Windows environment this must be set to your system time zone.
41 TIME_ZONE = 'America/New_York'
43 # Language code for this installation. All choices can be found here:
44 # http://www.i18nguy.com/unicode/language-identifiers.html
45 LANGUAGE_CODE = 'en-us'
49 # If you set this to False, Django will make some optimizations so as not
50 # to load the internationalization machinery.
53 # If you set this to False, Django will not format dates, numbers and
54 # calendars according to the current locale.
57 # If you set this to False, Django will not use timezone-aware datetimes.
60 # Absolute filesystem path to the directory that will hold user-uploaded files.
61 # Example: "/var/www/example.com/media/"
64 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
66 # Examples: "http://example.com/media/", "http://media.example.com/"
69 # Absolute path to the directory static files should be collected to.
70 # Don't put anything in this directory yourself; store your static files
71 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
72 # Example: "/var/www/example.com/static/"
75 # URL prefix for static files.
76 # Example: "http://example.com/static/", "http://static.example.com/"
77 STATIC_URL = '/static/'
79 # Additional locations of static files
80 STATICFILES_DIRS = ( "/opt/planetstack/core/static/",
81 # Put strings here, like "/home/html/static" or "C:/www/django/static".
82 # Always use forward slashes, even on Windows.
83 # Don't forget to use absolute paths, not relative paths.
86 # List of finder classes that know how to find static files in
88 STATICFILES_FINDERS = (
89 'django.contrib.staticfiles.finders.FileSystemFinder',
90 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
91 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
94 # Make this unique, and don't share it with anybody.
95 SECRET_KEY = 'i0=a)c7_#2)5m%k_fu#%53xap$tlqc+#&z5as+bl7&)(@be_f9'
97 # List of callables that know how to import templates from various sources.
99 'django.template.loaders.filesystem.Loader',
100 'django.template.loaders.app_directories.Loader',
101 # 'django.template.loaders.eggs.Loader',
104 MIDDLEWARE_CLASSES = (
105 'django.middleware.common.CommonMiddleware',
106 'django.contrib.sessions.middleware.SessionMiddleware',
107 'django.middleware.csrf.CsrfViewMiddleware',
108 'django.contrib.auth.middleware.AuthenticationMiddleware',
109 'django.contrib.messages.middleware.MessageMiddleware',
110 # Uncomment the next line for simple clickjacking protection:
111 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
114 ROOT_URLCONF = 'planetstack.urls'
116 # Python dotted path to the WSGI application used by Django's runserver.
117 WSGI_APPLICATION = 'planetstack.wsgi.application'
120 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
121 # Always use forward slashes, even on Windows.
122 # Don't forget to use absolute paths, not relative paths.
123 "/opt/planetstack/templates"
127 'django.contrib.auth',
128 'django.contrib.contenttypes',
129 'django.contrib.sessions',
130 # 'django.contrib.sites',
131 'django.contrib.messages',
132 'django.contrib.staticfiles',
133 # Uncomment the next line to enable the admin:
135 'django.contrib.admin',
136 # Uncomment the next line to enable admin documentation:
137 'django.contrib.admindocs',
149 # Added for django-suit form
150 TEMPLATE_CONTEXT_PROCESSORS = TCP + (
151 'django.core.context_processors.request',
154 # Django Suit configuration example
157 'ADMIN_NAME': 'OpenCloud',
158 # 'HEADER_DATE_FORMAT': 'l, j. F Y',
159 # 'HEADER_TIME_FORMAT': 'H:i',
162 #'SHOW_REQUIRED_ASTERISK': True, # Default True
163 'CONFIRM_UNSAVED_CHANGES': True, # Default True
166 # 'SEARCH_URL': '/admin/auth/user/',
168 # 'sites': 'icon-leaf',
169 # 'auth': 'icon-lock',
171 # 'MENU_OPEN_FIRST_CHILD': True, # Default True
179 'core.deploymentrole',
182 'core.planetstackrole',
183 'core.networktemplate',
184 'core.networkparametertype',
192 #{'app': 'core', 'icon':'icon-lock'},
193 #{'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')},
194 {'label': 'Deployments', 'icon':'icon-deployment', 'url': '/admin/core/deployment/'},
195 {'label': 'Sites', 'icon':'icon-site', 'url': '/admin/core/site/'},
196 {'label': 'Slices', 'icon':'icon-slice', 'url': '/admin/core/slice/'},
197 {'label': 'Users', 'icon':'icon-user', 'url': '/admin/core/user/'},
198 {'label': 'Request Routing', 'icon':'icon-cog', 'app': 'requestrouter'},
199 {'label': 'HyperCache', 'icon':'icon-cog', 'app': 'hpc'},
200 {'label': 'Syndicate', 'icon':'icon-cog', 'app': 'syndicate'},
201 #{'label': 'Configured Services', 'icon':'icon-cog', 'models': [{'label': 'Content Delivery Network', 'app':'hpc'}]},
203 # {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
204 # {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
205 # {'label': 'Settings', 'icon':'icon-cog', 'models': ('core.user', 'core.site')},
210 # 'LIST_PER_PAGE': 15
213 # A sample logging configuration. The only tangible logging
214 # performed by this configuration is to send an email to
215 # the site admins on every HTTP 500 error when DEBUG=False.
216 # See http://docs.djangoproject.com/en/dev/topics/logging for
217 # more details on how to customize your logging configuration.
220 'disable_existing_loggers': False,
222 'require_debug_false': {
223 '()': 'django.utils.log.RequireDebugFalse'
229 'filters': ['require_debug_false'],
230 'class': 'django.utils.log.AdminEmailHandler'
235 'handlers': ['mail_admins'],