mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 1 | # Django settings for frontend project. |
| 2 | |
showard | e90eb5e | 2008-07-25 20:54:21 +0000 | [diff] [blame] | 3 | import os |
mbligh | 437c3a6 | 2008-04-07 00:42:57 +0000 | [diff] [blame] | 4 | import common |
| 5 | from autotest_lib.client.common_lib import global_config |
showard | fa7ef63 | 2008-03-26 00:02:30 +0000 | [diff] [blame] | 6 | |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 7 | DEBUG = True |
| 8 | TEMPLATE_DEBUG = DEBUG |
| 9 | |
| 10 | FULL_ADMIN = False |
| 11 | |
| 12 | ADMINS = ( |
| 13 | # ('Your Name', 'your_email@domain.com'), |
| 14 | ) |
| 15 | |
| 16 | MANAGERS = ADMINS |
| 17 | |
showard | a5288b4 | 2009-07-28 20:06:08 +0000 | [diff] [blame] | 18 | DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', |
showard | fa7ef63 | 2008-03-26 00:02:30 +0000 | [diff] [blame] | 19 | # 'mysql', 'sqlite3' or 'ado_mssql'. |
jadmanski | 0afbb63 | 2008-06-06 21:10:57 +0000 | [diff] [blame] | 20 | DATABASE_PORT = '' # Set to empty string for default. |
showard | fa7ef63 | 2008-03-26 00:02:30 +0000 | [diff] [blame] | 21 | # Not used with sqlite3. |
| 22 | |
| 23 | c = global_config.global_config |
showard | 09096d8 | 2008-07-07 23:20:49 +0000 | [diff] [blame] | 24 | _section = 'AUTOTEST_WEB' |
| 25 | DATABASE_HOST = c.get_config_value(_section, "host") |
showard | fa7ef63 | 2008-03-26 00:02:30 +0000 | [diff] [blame] | 26 | # Or path to database file if using sqlite3. |
showard | 09096d8 | 2008-07-07 23:20:49 +0000 | [diff] [blame] | 27 | DATABASE_NAME = c.get_config_value(_section, "database") |
showard | fa7ef63 | 2008-03-26 00:02:30 +0000 | [diff] [blame] | 28 | # The following not used with sqlite3. |
showard | 09096d8 | 2008-07-07 23:20:49 +0000 | [diff] [blame] | 29 | DATABASE_USER = c.get_config_value(_section, "user") |
showard | 7a37db1 | 2009-01-08 23:31:08 +0000 | [diff] [blame] | 30 | DATABASE_PASSWORD = c.get_config_value(_section, "password", default='') |
showard | 09096d8 | 2008-07-07 23:20:49 +0000 | [diff] [blame] | 31 | |
showard | 1a573ca | 2008-09-11 01:32:03 +0000 | [diff] [blame] | 32 | DATABASE_READONLY_HOST = c.get_config_value(_section, "readonly_host", |
| 33 | default=DATABASE_HOST) |
showard | 09096d8 | 2008-07-07 23:20:49 +0000 | [diff] [blame] | 34 | DATABASE_READONLY_USER = c.get_config_value(_section, "readonly_user", |
| 35 | default=DATABASE_USER) |
showard | 7a37db1 | 2009-01-08 23:31:08 +0000 | [diff] [blame] | 36 | if DATABASE_READONLY_USER != DATABASE_USER: |
| 37 | DATABASE_READONLY_PASSWORD = c.get_config_value(_section, |
| 38 | "readonly_password", |
| 39 | default='') |
| 40 | else: |
| 41 | DATABASE_READONLY_PASSWORD = DATABASE_PASSWORD |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 42 | |
| 43 | # prefix applied to all URLs - useful if requests are coming through apache, |
| 44 | # and you need this app to coexist with others |
| 45 | URL_PREFIX = 'afe/server/' |
showard | 250d84d | 2010-01-12 21:59:48 +0000 | [diff] [blame^] | 46 | TKO_URL_PREFIX = 'new_tko/server/' |
showard | 26b7ec7 | 2009-12-21 22:43:57 +0000 | [diff] [blame] | 47 | PLANNER_URL_PREFIX = 'planner/server/' |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 48 | |
| 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' |
| 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 |
| 59 | LANGUAGE_CODE = 'en-us' |
| 60 | |
| 61 | SITE_ID = 1 |
| 62 | |
| 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 |
| 66 | |
| 67 | # Absolute path to the directory that holds media. |
| 68 | # Example: "/home/media/media.lawrence.com/" |
| 69 | MEDIA_ROOT = '' |
| 70 | |
| 71 | # URL that handles the media served from MEDIA_ROOT. |
| 72 | # Example: "http://media.lawrence.com" |
| 73 | MEDIA_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/". |
| 78 | ADMIN_MEDIA_PREFIX = '/media/' |
| 79 | |
| 80 | # Make this unique, and don't share it with anybody. |
| 81 | SECRET_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. |
| 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', |
| 88 | ) |
| 89 | |
| 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 | ) |
| 97 | |
| 98 | ROOT_URLCONF = 'frontend.urls' |
| 99 | |
| 100 | TEMPLATE_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. |
showard | 37c7fe6 | 2008-07-24 16:35:02 +0000 | [diff] [blame] | 104 | |
showard | e90eb5e | 2008-07-25 20:54:21 +0000 | [diff] [blame] | 105 | os.path.abspath(os.path.dirname(__file__) + '/templates') |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 106 | ) |
| 107 | |
| 108 | INSTALLED_APPS = ( |
| 109 | 'frontend.afe', |
showard | 250d84d | 2010-01-12 21:59:48 +0000 | [diff] [blame^] | 110 | 'frontend.tko', |
showard | 26b7ec7 | 2009-12-21 22:43:57 +0000 | [diff] [blame] | 111 | 'frontend.planner', |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 112 | 'django.contrib.admin', |
| 113 | 'django.contrib.auth', |
| 114 | 'django.contrib.contenttypes', |
| 115 | 'django.contrib.sessions', |
| 116 | 'django.contrib.sites', |
| 117 | ) |
| 118 | |
mbligh | e8819cd | 2008-02-15 16:48:40 +0000 | [diff] [blame] | 119 | AUTHENTICATION_BACKENDS = ( |
| 120 | 'frontend.apache_auth.SimpleAuthBackend', |
| 121 | ) |