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',
151 # Added for django-suit form
152 TEMPLATE_CONTEXT_PROCESSORS = TCP + (
153 'django.core.context_processors.request',
156 # Django Suit configuration example
159 'ADMIN_NAME': 'OpenCloud',
160 # 'HEADER_DATE_FORMAT': 'l, j. F Y',
161 # 'HEADER_TIME_FORMAT': 'H:i',
164 #'SHOW_REQUIRED_ASTERISK': True, # Default True
165 'CONFIRM_UNSAVED_CHANGES': True, # Default True
168 # 'SEARCH_URL': '/admin/auth/user/',
170 # 'sites': 'icon-leaf',
171 # 'auth': 'icon-lock',
173 # 'MENU_OPEN_FIRST_CHILD': True, # Default True
181 'core.deploymentrole',
184 'core.planetstackrole',
185 'core.networktemplate',
186 'core.networkparametertype',
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'}]},
205 # {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
206 # {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
207 # {'label': 'Settings', 'icon':'icon-cog', 'models': ('core.user', 'core.site')},
212 # 'LIST_PER_PAGE': 15
215 # 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.
222 'disable_existing_loggers': False,
224 'require_debug_false': {
225 '()': 'django.utils.log.RequireDebugFalse'
231 'filters': ['require_debug_false'],
232 'class': 'django.utils.log.AdminEmailHandler'
237 'handlers': ['mail_admins'],
244 BIGQUERY_TABLE = getattr(config, "bigquery_table", "demoevents")