Django-suit, add in Roles for specific classes site, slice, deployment, planetstack...
[plstackapi.git] / planetstack / planetstack / settings.py
1 from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
2
3 # Django settings for planetstack project.
4 from config import Config
5 config = Config()
6
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9
10 ADMINS = (
11     # ('Your Name', 'your_email@example.com'),
12 )
13
14 MANAGERS = ADMINS
15
16 DATABASES = {
17     'default': {
18         'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
19         'NAME': config.db_name,                      # Or path to database file if using sqlite3.
20         # The following settings are not used with sqlite3:
21         'USER': config.db_user,
22         'PASSWORD': config.db_password,
23         'HOST': config.db_host,                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
24         'PORT': '',                      # Set to empty string for default.
25     }
26 }
27
28 AUTH_USER_MODEL = 'core.User'
29
30
31 # Hosts/domain names that are valid for this site; required if DEBUG is False
32 # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
33 ALLOWED_HOSTS = []
34
35 # Local time zone for this installation. Choices can be found here:
36 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
37 # although not all choices may be available on all operating systems.
38 # In a Windows environment this must be set to your system time zone.
39 TIME_ZONE = 'America/New_York'
40
41 # Language code for this installation. All choices can be found here:
42 # http://www.i18nguy.com/unicode/language-identifiers.html
43 LANGUAGE_CODE = 'en-us'
44
45 SITE_ID = 1
46
47 # If you set this to False, Django will make some optimizations so as not
48 # to load the internationalization machinery.
49 USE_I18N = True
50
51 # If you set this to False, Django will not format dates, numbers and
52 # calendars according to the current locale.
53 USE_L10N = True
54
55 # If you set this to False, Django will not use timezone-aware datetimes.
56 USE_TZ = True
57
58 # Absolute filesystem path to the directory that will hold user-uploaded files.
59 # Example: "/var/www/example.com/media/"
60 MEDIA_ROOT = ''
61
62 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
63 # trailing slash.
64 # Examples: "http://example.com/media/", "http://media.example.com/"
65 MEDIA_URL = ''
66
67 # Absolute path to the directory static files should be collected to.
68 # Don't put anything in this directory yourself; store your static files
69 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
70 # Example: "/var/www/example.com/static/"
71 STATIC_ROOT = ''
72
73 # URL prefix for static files.
74 # Example: "http://example.com/static/", "http://static.example.com/"
75 STATIC_URL = '/static/'
76
77 # Additional locations of static files
78 STATICFILES_DIRS = ( "/opt/planetstack/core/static/",
79     # Put strings here, like "/home/html/static" or "C:/www/django/static".
80     # Always use forward slashes, even on Windows.
81     # Don't forget to use absolute paths, not relative paths.
82 )
83
84 # List of finder classes that know how to find static files in
85 # various locations.
86 STATICFILES_FINDERS = (
87     'django.contrib.staticfiles.finders.FileSystemFinder',
88     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
89 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
90 )
91
92 # Make this unique, and don't share it with anybody.
93 SECRET_KEY = 'i0=a)c7_#2)5m%k_fu#%53xap$tlqc+#&z5as+bl7&)(@be_f9'
94
95 # List of callables that know how to import templates from various sources.
96 TEMPLATE_LOADERS = (
97     'django.template.loaders.filesystem.Loader',
98     'django.template.loaders.app_directories.Loader',
99 #     'django.template.loaders.eggs.Loader',
100 )
101
102 MIDDLEWARE_CLASSES = (
103     'django.middleware.common.CommonMiddleware',
104     'django.contrib.sessions.middleware.SessionMiddleware',
105     'django.middleware.csrf.CsrfViewMiddleware',
106     'django.contrib.auth.middleware.AuthenticationMiddleware',
107     'django.contrib.messages.middleware.MessageMiddleware',
108     # Uncomment the next line for simple clickjacking protection:
109     # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
110 )
111
112 ROOT_URLCONF = 'planetstack.urls'
113
114 # Python dotted path to the WSGI application used by Django's runserver.
115 WSGI_APPLICATION = 'planetstack.wsgi.application'
116
117 TEMPLATE_DIRS = (
118     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
119     # Always use forward slashes, even on Windows.
120     # Don't forget to use absolute paths, not relative paths.
121     "/opt/planetstack/templates"
122 )
123
124 INSTALLED_APPS = (
125     'django.contrib.auth',
126     'django.contrib.contenttypes',
127     'django.contrib.sessions',
128 #    'django.contrib.sites',
129     'django.contrib.messages',
130     'django.contrib.staticfiles',
131     # Uncomment the next line to enable the admin:
132     'suit',
133     'django.contrib.admin',
134     # Uncomment the next line to enable admin documentation:
135     'django.contrib.admindocs',
136     'rest_framework',
137     'django_extensions',
138     'django_evolution',
139     'core',
140     'hpc',
141     'geoposition',
142 )
143
144
145 # Added for django-suit form 
146 TEMPLATE_CONTEXT_PROCESSORS = TCP + (
147     'django.core.context_processors.request',
148 )
149
150 # Django Suit configuration example
151 SUIT_CONFIG = {
152     # header
153     'ADMIN_NAME': 'PlanetStack',
154     # 'HEADER_DATE_FORMAT': 'l, j. F Y',
155     # 'HEADER_TIME_FORMAT': 'H:i',
156
157     # forms
158     #'SHOW_REQUIRED_ASTERISK': True,  # Default True
159     'CONFIRM_UNSAVED_CHANGES': True, # Default True
160
161     # menu
162     # 'SEARCH_URL': '/admin/auth/user/',
163     # 'MENU_ICONS': {
164     #    'sites': 'icon-leaf',
165     #    'auth': 'icon-lock',
166     # },
167     # 'MENU_OPEN_FIRST_CHILD': True, # Default True
168     'MENU_EXCLUDE': ('auth.group','auth'),
169     'MENU': (
170     ),
171     #     'sites',
172     #     {'app': 'auth', 'icon':'icon-lock', 'models': ('user', 'group')},
173     #     {'label': 'Settings', 'icon':'icon-cog', 'models': ('auth.user', 'auth.group')},
174     #     {'label': 'Support', 'icon':'icon-question-sign', 'url': '/support/'},
175     # ),
176
177     # misc
178     # 'LIST_PER_PAGE': 15
179 }
180
181 # A sample logging configuration. The only tangible logging
182 # performed by this configuration is to send an email to
183 # the site admins on every HTTP 500 error when DEBUG=False.
184 # See http://docs.djangoproject.com/en/dev/topics/logging for
185 # more details on how to customize your logging configuration.
186 LOGGING = {
187     'version': 1,
188     'disable_existing_loggers': False,
189     'filters': {
190         'require_debug_false': {
191             '()': 'django.utils.log.RequireDebugFalse'
192         }
193     },
194     'handlers': {
195         'mail_admins': {
196             'level': 'ERROR',
197             'filters': ['require_debug_false'],
198             'class': 'django.utils.log.AdminEmailHandler'
199         }
200     },
201     'loggers': {
202         'django.request': {
203             'handlers': ['mail_admins'],
204             'level': 'ERROR',
205             'propagate': True,
206         },
207     }
208 }