OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 # |
| 5 # Django settings for frontend project. |
| 6 |
| 7 import os |
| 8 import common |
| 9 from autotest_lib.client.common_lib import global_config |
| 10 |
| 11 DEBUG = True |
| 12 TEMPLATE_DEBUG = DEBUG |
| 13 |
| 14 FULL_ADMIN = False |
| 15 |
| 16 ADMINS = ( |
| 17 # ('Your Name', 'your_email@domain.com'), |
| 18 ) |
| 19 |
| 20 MANAGERS = ADMINS |
| 21 |
| 22 DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', |
| 23 # 'mysql', 'sqlite3' or 'ado_mssql'. |
| 24 DATABASE_PORT = '' # Set to empty string for default. |
| 25 # Not used with sqlite3. |
| 26 |
| 27 c = global_config.global_config |
| 28 _section = 'AUTOTEST_WEB' |
| 29 DATABASE_HOST = c.get_config_value(_section, "host") |
| 30 # Or path to database file if using sqlite3. |
| 31 DATABASE_NAME = c.get_config_value(_section, "database") |
| 32 # The following not used with sqlite3. |
| 33 DATABASE_USER = c.get_config_value(_section, "user") |
| 34 DATABASE_PASSWORD = c.get_config_value(_section, "password", default='') |
| 35 |
| 36 DATABASE_READONLY_HOST = c.get_config_value(_section, "readonly_host", |
| 37 default=DATABASE_HOST) |
| 38 DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user", |
| 39 default=DATABASE_USER) |
| 40 if DATABASE_READONLY_USER != DATABASE_USER: |
| 41 DATABASE_READONLY_PASSWORD = c.get_config_value(_section, |
| 42 "readonly_password", |
| 43 default='') |
| 44 else: |
| 45 DATABASE_READONLY_PASSWORD = DATABASE_PASSWORD |
| 46 |
| 47 |
| 48 # Local time zone for this installation. Choices can be found here: |
| 49 # http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIME
ZONE-SET-TABLE |
| 50 # although not all variations may be possible on all operating systems. |
| 51 # If running in a Windows environment this must be set to the same as your |
| 52 # system time zone. |
| 53 TIME_ZONE = 'America/Los_Angeles' |
| 54 |
| 55 # Language code for this installation. All choices can be found here: |
| 56 # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes |
| 57 # http://blogs.law.harvard.edu/tech/stories/storyReader$15 |
| 58 LANGUAGE_CODE = 'en-us' |
| 59 |
| 60 # List of callables that know how to import templates from various sources. |
| 61 TEMPLATE_LOADERS = ( |
| 62 'django.template.loaders.filesystem.load_template_source', |
| 63 'django.template.loaders.app_directories.load_template_source', |
| 64 ) |
| 65 |
| 66 MIDDLEWARE_CLASSES = ( |
| 67 'django.middleware.common.CommonMiddleware', |
| 68 'django.contrib.sessions.middleware.SessionMiddleware', |
| 69 'frontend.apache_auth.ApacheAuthMiddleware', |
| 70 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 71 'django.middleware.doc.XViewMiddleware', |
| 72 'frontend.shared.json_html_formatter.JsonToHtmlMiddleware', |
| 73 ) |
| 74 |
| 75 ROOT_URLCONF = 'dashboard.urls' |
| 76 |
| 77 TEMPLATE_DIRS = ( |
| 78 # Put strings here, like "/home/html/django_templates" or "C:/www/django/tem
plates". |
| 79 # Always use forward slashes, even on Windows. |
| 80 # Don't forget to use absolute paths, not relative paths. |
| 81 os.path.abspath(os.path.dirname(__file__) + '/templates') |
| 82 ) |
| 83 |
| 84 INSTALLED_APPS = ( |
| 85 'dashboard', |
| 86 ) |
| 87 |
| 88 AUTHENTICATION_BACKENDS = ( |
| 89 'frontend.apache_auth.SimpleAuthBackend', |
| 90 ) |
OLD | NEW |