blob: bdd849caf4dc74a5b4fd60848bc34a583684a403 [file] [log] [blame]
mblighe8819cd2008-02-15 16:48:40 +00001# Django settings for frontend project.
2
showarde90eb5e2008-07-25 20:54:21 +00003import os
mbligh437c3a62008-04-07 00:42:57 +00004import common
5from autotest_lib.client.common_lib import global_config
showardfa7ef632008-03-26 00:02:30 +00006
mblighe8819cd2008-02-15 16:48:40 +00007DEBUG = True
8TEMPLATE_DEBUG = DEBUG
9
10FULL_ADMIN = False
11
12ADMINS = (
13 # ('Your Name', 'your_email@domain.com'),
14)
15
16MANAGERS = ADMINS
17
showarda5288b42009-07-28 20:06:08 +000018DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql',
showardfa7ef632008-03-26 00:02:30 +000019 # 'mysql', 'sqlite3' or 'ado_mssql'.
jadmanski0afbb632008-06-06 21:10:57 +000020DATABASE_PORT = '' # Set to empty string for default.
showardfa7ef632008-03-26 00:02:30 +000021 # Not used with sqlite3.
22
23c = global_config.global_config
showard09096d82008-07-07 23:20:49 +000024_section = 'AUTOTEST_WEB'
25DATABASE_HOST = c.get_config_value(_section, "host")
showardfa7ef632008-03-26 00:02:30 +000026# Or path to database file if using sqlite3.
showard09096d82008-07-07 23:20:49 +000027DATABASE_NAME = c.get_config_value(_section, "database")
showardfa7ef632008-03-26 00:02:30 +000028# The following not used with sqlite3.
showard09096d82008-07-07 23:20:49 +000029DATABASE_USER = c.get_config_value(_section, "user")
showard7a37db12009-01-08 23:31:08 +000030DATABASE_PASSWORD = c.get_config_value(_section, "password", default='')
showard09096d82008-07-07 23:20:49 +000031
showard1a573ca2008-09-11 01:32:03 +000032DATABASE_READONLY_HOST = c.get_config_value(_section, "readonly_host",
33 default=DATABASE_HOST)
showard09096d82008-07-07 23:20:49 +000034DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user",
35 default=DATABASE_USER)
showard7a37db12009-01-08 23:31:08 +000036if DATABASE_READONLY_USER != DATABASE_USER:
37 DATABASE_READONLY_PASSWORD = c.get_config_value(_section,
38 "readonly_password",
39 default='')
40else:
41 DATABASE_READONLY_PASSWORD = DATABASE_PASSWORD
mblighe8819cd2008-02-15 16:48:40 +000042
43# prefix applied to all URLs - useful if requests are coming through apache,
44# and you need this app to coexist with others
45URL_PREFIX = 'afe/server/'
showard250d84d2010-01-12 21:59:48 +000046TKO_URL_PREFIX = 'new_tko/server/'
showard26b7ec72009-12-21 22:43:57 +000047PLANNER_URL_PREFIX = 'planner/server/'
mblighe8819cd2008-02-15 16:48:40 +000048
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.
54TIME_ZONE = 'America/Los_Angeles'
55
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
59LANGUAGE_CODE = 'en-us'
60
61SITE_ID = 1
62
63# If you set this to False, Django will make some optimizations so as not
64# to load the internationalization machinery.
65USE_I18N = True
66
67# Absolute path to the directory that holds media.
68# Example: "/home/media/media.lawrence.com/"
69MEDIA_ROOT = ''
70
71# URL that handles the media served from MEDIA_ROOT.
72# Example: "http://media.lawrence.com"
73MEDIA_URL = ''
74
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/".
78ADMIN_MEDIA_PREFIX = '/media/'
79
80# Make this unique, and don't share it with anybody.
81SECRET_KEY = 'pn-t15u(epetamdflb%dqaaxw+5u&2#0u-jah70w1l*_9*)=n7'
82
83# List of callables that know how to import templates from various sources.
84TEMPLATE_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',
88)
89
90MIDDLEWARE_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)
97
98ROOT_URLCONF = 'frontend.urls'
99
100TEMPLATE_DIRS = (
101 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
102 # Always use forward slashes, even on Windows.
103 # Don't forget to use absolute paths, not relative paths.
showard37c7fe62008-07-24 16:35:02 +0000104
showarde90eb5e2008-07-25 20:54:21 +0000105 os.path.abspath(os.path.dirname(__file__) + '/templates')
mblighe8819cd2008-02-15 16:48:40 +0000106)
107
108INSTALLED_APPS = (
109 'frontend.afe',
showard250d84d2010-01-12 21:59:48 +0000110 'frontend.tko',
showard26b7ec72009-12-21 22:43:57 +0000111 'frontend.planner',
mblighe8819cd2008-02-15 16:48:40 +0000112 'django.contrib.admin',
113 'django.contrib.auth',
114 'django.contrib.contenttypes',
115 'django.contrib.sessions',
116 'django.contrib.sites',
117)
118
mblighe8819cd2008-02-15 16:48:40 +0000119AUTHENTICATION_BACKENDS = (
120 'frontend.apache_auth.SimpleAuthBackend',
121)