Ticket #14428: settings.py

File settings.py, 5.2 KB (added by Mark Jones, 14 years ago)

Sample Project settings.py file to deal with same

Line 
1# Django settings for sampleproject project.
2from os.path import dirname, join
3_dir = dirname(__file__)
4
5LIB_PATH = join(_dir,'..')
6import sys
7sys.path.append(LIB_PATH)
8
9DEBUG = True
10TEMPLATE_DEBUG = DEBUG
11
12ADMINS = (
13 # ('Your Name', 'your_email@domain.com'),
14)
15
16MANAGERS = ADMINS
17
18DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
19DATABASE_NAME = join(_dir,'data.sqlite') # Or path to database file if using sqlite3.
20DATABASE_USER = '' # Not used with sqlite3.
21DATABASE_PASSWORD = '' # Not used with sqlite3.
22DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
23DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
24
25# Local time zone for this installation. Choices can be found here:
26# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
27# although not all choices may be available on all operating systems.
28# If running in a Windows environment this must be set to the same as your
29# system time zone.
30TIME_ZONE = 'America/Chicago'
31
32# Language code for this installation. All choices can be found here:
33# http://www.i18nguy.com/unicode/language-identifiers.html
34LANGUAGE_CODE = 'en-us'
35
36SITE_ID = 1
37
38# If you set this to False, Django will make some optimizations so as not
39# to load the internationalization machinery.
40USE_I18N = True
41
42# Absolute path to the directory that holds media.
43# Example: "/home/media/media.lawrence.com/"
44MEDIA_ROOT = join(_dir, 'static/')
45
46# URL that handles the media served from MEDIA_ROOT. Make sure to use a
47# trailing slash if there is a path component (optional in other cases).
48# Examples: "http://media.lawrence.com", "http://example.com/media/"
49MEDIA_URL = '/static/'
50
51# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
52# trailing slash.
53# Examples: "http://foo.com/media/", "/media/".
54ADMIN_MEDIA_PREFIX = '/media/'
55
56# Make this unique, and don't share it with anybody.
57SECRET_KEY = 'ih3^*u=ndnu+nbuv&0)zbd5m2gt%5alzu9*%s!bze2w&r426(6'
58
59# List of callables that know how to import templates from various sources.
60TEMPLATE_LOADERS = (
61 'sampleproject.flags.loaders.filesystem.load_template_source',
62 'sampleproject.flags.loaders.app_directories.load_template_source',
63 'django.template.loaders.filesystem.load_template_source',
64 'django.template.loaders.app_directories.load_template_source',
65# 'django.template.loaders.eggs.load_template_source',
66)
67
68MIDDLEWARE_CLASSES = (
69 'django.middleware.common.CommonMiddleware',
70 'django.contrib.sessions.middleware.SessionMiddleware',
71 "django.middleware.csrf.CsrfViewMiddleware",
72 'django.contrib.auth.middleware.AuthenticationMiddleware',
73 'django.middleware.locale.LocaleMiddleware',
74 'django.middleware.doc.XViewMiddleware',
75 'django.middleware.csrf.CsrfResponseMiddleware',
76)
77
78ROOT_URLCONF = 'sampleproject.urls'
79
80TEMPLATE_DIRS = (
81 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
82 # Always use forward slashes, even on Windows.
83 # Don't forget to use absolute paths, not relative paths.
84 join(_dir,'..', 'goflow', 'apptools', 'templates'),
85 join(_dir,'..', 'goflow', 'runtime', 'templates')
86)
87
88TEMPLATE_CONTEXT_PROCESSORS = [
89 "django.core.context_processors.auth",
90 "django.core.context_processors.debug",
91 "django.core.context_processors.i18n",
92 "django.core.context_processors.media",
93 "django.core.context_processors.request",
94 "django.contrib.messages.context_processors.messages",
95]
96
97INSTALLED_APPS = (
98 'django.contrib.auth',
99 'django.contrib.contenttypes',
100 'django.contrib.sessions',
101 'django.contrib.sites',
102 'django.contrib.admin',
103 'django.contrib.admindocs',
104 'goflow.workflow',
105 'goflow.runtime',
106 'goflow.apptools',
107 'sampleproject.sampleapp',
108 'sampleproject.flags',
109)
110
111LOGIN_URL = '/accounts/login'
112
113# user profile model
114AUTH_PROFILE_MODULE = 'workflow.userprofile'
115
116# mail notification
117DEFAULT_FROM_EMAIL = 'sample@project.com'
118EMAIL_HOST = 'localhost'
119
120# user that executes auto processes
121WF_USER_AUTO = 'auto'
122# used to build application url like: http://[web_host]/[WF_APPS_PREFIX]/[application]
123WF_APPS_PREFIX = '/sampleapp'
124# used to find push functions
125WF_PUSH_APPS_PREFIX = 'sampleproject.sampleapp.pushapps'
126
127# test users for fast switch (with DEBUG=TRUE only)
128TEST_USERS = (('admin','admin'), ('user1','user1'),
129 ('user2','user2'), ('userg1','userg1'))
130
131# the FLAGS_I18N_PREFIX parameter must match urls.py item:
132# urls.py > (r'^PREFIX/i18n/', include('django.conf.urls.i18n')),
133# settings.py > FLAGS_I18N_PREFIX = '/PREFIX/i18n/'
134FLAGS_I18N_PREFIX = '/lang/i18n/'
135# flags served by local server
136FLAGS_URL = MEDIA_URL + "flags/"
137# flags served by net server
138#FLAGS_URL = 'http://djangodev.free.fr/flags/'
139
140# languages
141ugettext = lambda s: s
142LANGUAGES = (
143 ('ar', ugettext('Arabic')),
144 ('fr', ugettext('French')),
145 ('en', ugettext('English')),
146 ('es', ugettext('Spanish')),
147 ('de', ugettext('German')),
148 ('pl', ugettext('Polish')),
149)
150
151
Back to Top