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