Add a new logo for the autotest web interface
[autotest-zwu.git] / frontend / settings.py
blob8497cf2c9a5b1a3074ddd25cd3b0fd0678b7daca
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 = 'autotest_lib.frontend.db.backends.afe'
19 # 'postgresql_psycopg2', 'postgresql',
20 # 'mysql', 'sqlite3' or 'ado_mssql'.
21 DATABASE_PORT = '' # Set to empty string for default.
22 # Not used with sqlite3.
24 c = global_config.global_config
25 _section = 'AUTOTEST_WEB'
26 DATABASE_HOST = c.get_config_value(_section, "host")
27 # Or path to database file if using sqlite3.
28 DATABASE_NAME = c.get_config_value(_section, "database")
29 # The following not used with sqlite3.
30 DATABASE_USER = c.get_config_value(_section, "user")
31 DATABASE_PASSWORD = c.get_config_value(_section, "password", default='')
33 DATABASE_READONLY_HOST = c.get_config_value(_section, "readonly_host",
34 default=DATABASE_HOST)
35 DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user",
36 default=DATABASE_USER)
37 if DATABASE_READONLY_USER != DATABASE_USER:
38 DATABASE_READONLY_PASSWORD = c.get_config_value(_section,
39 "readonly_password",
40 default='')
41 else:
42 DATABASE_READONLY_PASSWORD = DATABASE_PASSWORD
44 # prefix applied to all URLs - useful if requests are coming through apache,
45 # and you need this app to coexist with others
46 URL_PREFIX = 'afe/server/'
47 TKO_URL_PREFIX = 'new_tko/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 'django.contrib.admin',
113 'django.contrib.auth',
114 'django.contrib.contenttypes',
115 'django.contrib.sessions',
116 'django.contrib.sites',
119 AUTHENTICATION_BACKENDS = (
120 'frontend.apache_auth.SimpleAuthBackend',