server/autotest.py: Fixing a couple of minor exception formatting errors
[autotest-zwu.git] / frontend / settings.py
blob3ac7f805944c6a93b7e26c5abe55951dec871018
1 # Django settings for frontend project.
3 import os
4 import common
5 from autotest_lib.client.common_lib import global_config
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
10 FULL_ADMIN = False
12 ADMINS = (
13 # ('Your Name', 'your_email@domain.com'),
16 MANAGERS = ADMINS
18 DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql',
19 # 'mysql', 'sqlite3' or 'ado_mssql'.
20 DATABASE_PORT = '' # Set to empty string for default.
21 # Not used with sqlite3.
23 c = global_config.global_config
24 _section = 'AUTOTEST_WEB'
25 DATABASE_HOST = c.get_config_value(_section, "host")
26 # Or path to database file if using sqlite3.
27 DATABASE_NAME = c.get_config_value(_section, "database")
28 # The following not used with sqlite3.
29 DATABASE_USER = c.get_config_value(_section, "user")
30 DATABASE_PASSWORD = c.get_config_value(_section, "password", default='')
32 DATABASE_READONLY_HOST = c.get_config_value(_section, "readonly_host",
33 default=DATABASE_HOST)
34 DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user",
35 default=DATABASE_USER)
36 if DATABASE_READONLY_USER != DATABASE_USER:
37 DATABASE_READONLY_PASSWORD = c.get_config_value(_section,
38 "readonly_password",
39 default='')
40 else:
41 DATABASE_READONLY_PASSWORD = DATABASE_PASSWORD
43 # prefix applied to all URLs - useful if requests are coming through apache,
44 # and you need this app to coexist with others
45 URL_PREFIX = 'afe/server/'
46 TKO_URL_PREFIX = 'new_tko/server/'
47 PLANNER_URL_PREFIX = 'planner/server/'
49 # Local time zone for this installation. Choices can be found here:
50 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
51 # although not all variations may be possible on all operating systems.
52 # If running in a Windows environment this must be set to the same as your
53 # system time zone.
54 TIME_ZONE = 'America/Los_Angeles'
56 # Language code for this installation. All choices can be found here:
57 # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
58 # http://blogs.law.harvard.edu/tech/stories/storyReader$15
59 LANGUAGE_CODE = 'en-us'
61 SITE_ID = 1
63 # If you set this to False, Django will make some optimizations so as not
64 # to load the internationalization machinery.
65 USE_I18N = True
67 # Absolute path to the directory that holds media.
68 # Example: "/home/media/media.lawrence.com/"
69 MEDIA_ROOT = ''
71 # URL that handles the media served from MEDIA_ROOT.
72 # Example: "http://media.lawrence.com"
73 MEDIA_URL = ''
75 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
76 # trailing slash.
77 # Examples: "http://foo.com/media/", "/media/".
78 ADMIN_MEDIA_PREFIX = '/media/'
80 # Make this unique, and don't share it with anybody.
81 SECRET_KEY = 'pn-t15u(epetamdflb%dqaaxw+5u&2#0u-jah70w1l*_9*)=n7'
83 # List of callables that know how to import templates from various sources.
84 TEMPLATE_LOADERS = (
85 'django.template.loaders.filesystem.load_template_source',
86 'django.template.loaders.app_directories.load_template_source',
87 # 'django.template.loaders.eggs.load_template_source',
90 MIDDLEWARE_CLASSES = (
91 'django.middleware.common.CommonMiddleware',
92 'django.contrib.sessions.middleware.SessionMiddleware',
93 'frontend.apache_auth.ApacheAuthMiddleware',
94 'django.contrib.auth.middleware.AuthenticationMiddleware',
95 'django.middleware.doc.XViewMiddleware',
96 'frontend.shared.json_html_formatter.JsonToHtmlMiddleware',
99 ROOT_URLCONF = 'frontend.urls'
101 TEMPLATE_DIRS = (
102 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
103 # Always use forward slashes, even on Windows.
104 # Don't forget to use absolute paths, not relative paths.
106 os.path.abspath(os.path.dirname(__file__) + '/templates')
109 INSTALLED_APPS = (
110 'frontend.afe',
111 'frontend.tko',
112 'frontend.planner',
113 'django.contrib.admin',
114 'django.contrib.auth',
115 'django.contrib.contenttypes',
116 'django.contrib.sessions',
117 'django.contrib.sites',
120 AUTHENTICATION_BACKENDS = (
121 'frontend.apache_auth.SimpleAuthBackend',