summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastermain/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastermain/settings.py')
-rw-r--r--bitbake/lib/toaster/toastermain/settings.py190
1 files changed, 190 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py
new file mode 100644
index 0000000000..dd1e25c087
--- /dev/null
+++ b/bitbake/lib/toaster/toastermain/settings.py
@@ -0,0 +1,190 @@
1#
2# BitBake Toaster Implementation
3#
4# Copyright (C) 2013 Intel Corporation
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License version 2 as
8# published by the Free Software Foundation.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along
16# with this program; if not, write to the Free Software Foundation, Inc.,
17# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
19# Django settings for Toaster project.
20
21DEBUG = True
22TEMPLATE_DEBUG = DEBUG
23
24ADMINS = (
25 # ('Your Name', 'your_email@example.com'),
26)
27
28MANAGERS = ADMINS
29
30DATABASES = {
31 'default': {
32 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
33 'NAME': 'toaster.sqlite', # Or path to database file if using sqlite3.
34 'USER': '',
35 'PASSWORD': '',
36 'HOST': '127.0.0.1', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
37 'PORT': '3306', # Set to empty string for default.
38 }
39}
40
41# Hosts/domain names that are valid for this site; required if DEBUG is False
42# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
43ALLOWED_HOSTS = []
44
45# Local time zone for this installation. Choices can be found here:
46# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
47# although not all choices may be available on all operating systems.
48# In a Windows environment this must be set to your system time zone.
49
50# Always use local computer's time zone
51#TIME_ZONE = ''
52
53# Language code for this installation. All choices can be found here:
54# http://www.i18nguy.com/unicode/language-identifiers.html
55LANGUAGE_CODE = 'en-us'
56
57SITE_ID = 1
58
59# If you set this to False, Django will make some optimizations so as not
60# to load the internationalization machinery.
61USE_I18N = True
62
63# If you set this to False, Django will not format dates, numbers and
64# calendars according to the current locale.
65USE_L10N = True
66
67# If you set this to False, Django will not use timezone-aware datetimes.
68USE_TZ = False
69
70# Absolute filesystem path to the directory that will hold user-uploaded files.
71# Example: "/var/www/example.com/media/"
72MEDIA_ROOT = ''
73
74# URL that handles the media served from MEDIA_ROOT. Make sure to use a
75# trailing slash.
76# Examples: "http://example.com/media/", "http://media.example.com/"
77MEDIA_URL = ''
78
79# Absolute path to the directory static files should be collected to.
80# Don't put anything in this directory yourself; store your static files
81# in apps' "static/" subdirectories and in STATICFILES_DIRS.
82# Example: "/var/www/example.com/static/"
83STATIC_ROOT = ''
84
85# URL prefix for static files.
86# Example: "http://example.com/static/", "http://static.example.com/"
87STATIC_URL = '/static/'
88
89# Additional locations of static files
90STATICFILES_DIRS = (
91 # Put strings here, like "/home/html/static" or "C:/www/django/static".
92 # Always use forward slashes, even on Windows.
93 # Don't forget to use absolute paths, not relative paths.
94)
95
96# List of finder classes that know how to find static files in
97# various locations.
98STATICFILES_FINDERS = (
99 'django.contrib.staticfiles.finders.FileSystemFinder',
100 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
101# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
102)
103
104# Make this unique, and don't share it with anybody.
105SECRET_KEY = 'NOT_SUITABLE_FOR_HOSTED_DEPLOYMENT'
106
107# List of callables that know how to import templates from various sources.
108TEMPLATE_LOADERS = (
109 'django.template.loaders.filesystem.Loader',
110 'django.template.loaders.app_directories.Loader',
111# 'django.template.loaders.eggs.Loader',
112)
113
114MIDDLEWARE_CLASSES = (
115 'django.middleware.common.CommonMiddleware',
116 'django.contrib.sessions.middleware.SessionMiddleware',
117 'django.middleware.csrf.CsrfViewMiddleware',
118 'django.contrib.auth.middleware.AuthenticationMiddleware',
119 'django.contrib.messages.middleware.MessageMiddleware',
120 # Uncomment the next line for simple clickjacking protection:
121 # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
122)
123
124ROOT_URLCONF = 'toastermain.urls'
125
126# Python dotted path to the WSGI application used by Django's runserver.
127WSGI_APPLICATION = 'toastermain.wsgi.application'
128
129TEMPLATE_DIRS = (
130 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
131 # Always use forward slashes, even on Windows.
132 # Don't forget to use absolute paths, not relative paths.
133)
134
135INSTALLED_APPS = (
136 #'django.contrib.auth',
137 #'django.contrib.contenttypes',
138 #'django.contrib.sessions',
139 #'django.contrib.sites',
140 #'django.contrib.messages',
141 'django.contrib.staticfiles',
142 # Uncomment the next line to enable the admin:
143 # 'django.contrib.admin',
144 # Uncomment the next line to enable admin documentation:
145 # 'django.contrib.admindocs',
146 'orm',
147 'toastermain',
148 'bldviewer',
149 'toastergui',
150)
151
152# A sample logging configuration. The only tangible logging
153# performed by this configuration is to send an email to
154# the site admins on every HTTP 500 error when DEBUG=False.
155# See http://docs.djangoproject.com/en/dev/topics/logging for
156# more details on how to customize your logging configuration.
157LOGGING = {
158 'version': 1,
159 'disable_existing_loggers': False,
160 'filters': {
161 'require_debug_false': {
162 '()': 'django.utils.log.RequireDebugFalse'
163 }
164 },
165 'handlers': {
166 'mail_admins': {
167 'level': 'ERROR',
168 'filters': ['require_debug_false'],
169 'class': 'django.utils.log.AdminEmailHandler'
170 }
171 },
172 'loggers': {
173 'django.request': {
174 'handlers': ['mail_admins'],
175 'level': 'ERROR',
176 'propagate': True,
177 },
178 }
179}
180
181# If we're using sqlite, we need to tweak the performance a bit
182from django.db.backends.signals import connection_created
183def activate_synchronous_off(sender, connection, **kwargs):
184 if connection.vendor == 'sqlite':
185 cursor = connection.cursor()
186 cursor.execute('PRAGMA synchronous = 0;')
187connection_created.connect(activate_synchronous_off)
188#
189
190