blob: 98e34bd4a6b4edb1007a12c4752e92c1ca48da64 [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
jadmanski0afbb632008-06-06 21:10:57 +000018DATABASE_ENGINE = 'mysql_old' # '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")
30DATABASE_PASSWORD = c.get_config_value(_section, "password")
31
32DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user",
33 default=DATABASE_USER)
34DATABASE_READONLY_PASSWORD = c.get_config_value(_section, "readonly_password",
35 default=DATABASE_PASSWORD)
jadmanski0afbb632008-06-06 21:10:57 +000036
mblighe8819cd2008-02-15 16:48:40 +000037
38# prefix applied to all URLs - useful if requests are coming through apache,
39# and you need this app to coexist with others
40URL_PREFIX = 'afe/server/'
41
42# Local time zone for this installation. Choices can be found here:
43# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
44# although not all variations may be possible on all operating systems.
45# If running in a Windows environment this must be set to the same as your
46# system time zone.
47TIME_ZONE = 'America/Los_Angeles'
48
49# Language code for this installation. All choices can be found here:
50# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
51# http://blogs.law.harvard.edu/tech/stories/storyReader$15
52LANGUAGE_CODE = 'en-us'
53
54SITE_ID = 1
55
56# If you set this to False, Django will make some optimizations so as not
57# to load the internationalization machinery.
58USE_I18N = True
59
60# Absolute path to the directory that holds media.
61# Example: "/home/media/media.lawrence.com/"
62MEDIA_ROOT = ''
63
64# URL that handles the media served from MEDIA_ROOT.
65# Example: "http://media.lawrence.com"
66MEDIA_URL = ''
67
68# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
69# trailing slash.
70# Examples: "http://foo.com/media/", "/media/".
71ADMIN_MEDIA_PREFIX = '/media/'
72
73# Make this unique, and don't share it with anybody.
74SECRET_KEY = 'pn-t15u(epetamdflb%dqaaxw+5u&2#0u-jah70w1l*_9*)=n7'
75
76# List of callables that know how to import templates from various sources.
77TEMPLATE_LOADERS = (
78 'django.template.loaders.filesystem.load_template_source',
79 'django.template.loaders.app_directories.load_template_source',
80# 'django.template.loaders.eggs.load_template_source',
81)
82
83MIDDLEWARE_CLASSES = (
84 'django.middleware.common.CommonMiddleware',
85 'django.contrib.sessions.middleware.SessionMiddleware',
86 'frontend.apache_auth.ApacheAuthMiddleware',
87 'django.contrib.auth.middleware.AuthenticationMiddleware',
88 'django.middleware.doc.XViewMiddleware',
89)
90
91ROOT_URLCONF = 'frontend.urls'
92
93TEMPLATE_DIRS = (
94 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
95 # Always use forward slashes, even on Windows.
96 # Don't forget to use absolute paths, not relative paths.
showard37c7fe62008-07-24 16:35:02 +000097
showarde90eb5e2008-07-25 20:54:21 +000098 os.path.abspath(os.path.dirname(__file__) + '/templates')
mblighe8819cd2008-02-15 16:48:40 +000099)
100
101INSTALLED_APPS = (
102 'frontend.afe',
103 'django.contrib.admin',
104 'django.contrib.auth',
105 'django.contrib.contenttypes',
106 'django.contrib.sessions',
107 'django.contrib.sites',
108)
109
110# you'll need to grant your database user permissions on database
111# test_<normal database name> to run tests
112TEST_RUNNER = 'frontend.afe.test.run_tests'
113
114AUTHENTICATION_BACKENDS = (
115 'frontend.apache_auth.SimpleAuthBackend',
116)