|
1 # Django settings for hgbook project. |
|
2 |
|
3 import os, sys |
|
4 |
|
5 DEBUG = True |
|
6 TEMPLATE_DEBUG = DEBUG |
|
7 |
|
8 ADMINS = ( |
|
9 ("Bryan O'Sullivan", 'bos@serpentine.com'), |
|
10 ) |
|
11 |
|
12 MANAGERS = ADMINS |
|
13 |
|
14 ROOT = os.path.dirname(sys.modules[__name__].__file__) |
|
15 |
|
16 DJAPIAN_DATABASE_PATH = '/home/amit/hgbook-alqua/web/hgbook' |
|
17 DJAPIAN_STEMMING_LANG = 'en' |
|
18 |
|
19 |
|
20 try: |
|
21 from secrets import DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, \ |
|
22 DATABASE_PASSWORD, DATABASE_HOST, DATABASE_PORT, SECRET_KEY |
|
23 except ImportError: |
|
24 print >> sys.stderr, 'Faking up some database configuration for you' |
|
25 DATABASE_ENGINE = 'sqlite3' |
|
26 DATABASE_NAME = os.path.join(ROOT, '.database.sqlite3') |
|
27 DATABASE_USER = '' |
|
28 DATABASE_PASSWORD = '' |
|
29 DATABASE_HOST = '' |
|
30 DATABASE_PORT = '' |
|
31 SECRET_KEY = '' |
|
32 |
|
33 # Local time zone for this installation. Choices can be found here: |
|
34 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
35 # although not all choices may be avilable on all operating systems. |
|
36 # If running in a Windows environment this must be set to the same as your |
|
37 # system time zone. |
|
38 TIME_ZONE = 'America/Los_Angeles' |
|
39 |
|
40 # Language code for this installation. All choices can be found here: |
|
41 # http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes |
|
42 LANGUAGE_CODE = 'en-us' |
|
43 |
|
44 SITE_ID = 1 |
|
45 |
|
46 # If you set this to False, Django will make some optimizations so as not |
|
47 # to load the internationalization machinery. |
|
48 USE_I18N = True |
|
49 |
|
50 # Absolute path to the directory that holds media. |
|
51 # Example: "/home/media/media.lawrence.com/" |
|
52 MEDIA_ROOT = '' |
|
53 |
|
54 # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
55 # trailing slash if there is a path component (optional in other cases). |
|
56 # Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
57 MEDIA_URL = '' |
|
58 |
|
59 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
60 # trailing slash. |
|
61 # Examples: "http://foo.com/media/", "/media/". |
|
62 ADMIN_MEDIA_PREFIX = '/media/' |
|
63 |
|
64 |
|
65 #Index Directories for searching static html files |
|
66 DD_SEARCH_INDEX_DIR = '../html/' |
|
67 |
|
68 |
|
69 |
|
70 # List of callables that know how to import templates from various sources. |
|
71 TEMPLATE_LOADERS = ( |
|
72 'django.template.loaders.filesystem.load_template_source', |
|
73 'django.template.loaders.app_directories.load_template_source', |
|
74 # 'django.template.loaders.eggs.load_template_source', |
|
75 ) |
|
76 |
|
77 MIDDLEWARE_CLASSES = ( |
|
78 'django.middleware.common.CommonMiddleware', |
|
79 'django.contrib.sessions.middleware.SessionMiddleware', |
|
80 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
81 'django.middleware.doc.XViewMiddleware', |
|
82 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware' |
|
83 ) |
|
84 |
|
85 ROOT_URLCONF = 'hgbook.urls' |
|
86 |
|
87 TEMPLATE_DIRS = ( |
|
88 os.path.join(ROOT, 'templates') |
|
89 ) |
|
90 |
|
91 INSTALLED_APPS = ( |
|
92 'django.contrib.admin', |
|
93 'django.contrib.auth', |
|
94 'django.contrib.contenttypes', |
|
95 'django.contrib.sessions', |
|
96 'django.contrib.sites', |
|
97 'django.contrib.flatpages', |
|
98 'hgbook.comments', |
|
99 ) |