gremmie@1
|
1 # Django settings for gpp project.
|
gremmie@1
|
2
|
gremmie@1
|
3 import os
|
gremmie@1
|
4 import platform
|
bgneal@38
|
5 from decimal import Decimal
|
bgneal@38
|
6 import logging
|
bgneal@38
|
7
|
gremmie@1
|
8 import local_settings
|
bgneal@35
|
9
|
gremmie@1
|
10 project_path = os.path.abspath(os.path.split(__file__)[0])
|
gremmie@1
|
11
|
gremmie@1
|
12 DEBUG = local_settings.DEBUG
|
gremmie@1
|
13 TEMPLATE_DEBUG = DEBUG
|
gremmie@1
|
14
|
gremmie@1
|
15 ADMINS = (
|
gremmie@1
|
16 ('Brian Neal', 'admin@surfguitar101.com'),
|
gremmie@1
|
17 )
|
gremmie@1
|
18
|
gremmie@1
|
19 AUTH_PROFILE_MODULE = 'bio.userprofile'
|
gremmie@1
|
20
|
gremmie@1
|
21 MANAGERS = ADMINS
|
gremmie@1
|
22
|
gremmie@1
|
23 DATABASE_ENGINE = local_settings.DATABASE_ENGINE
|
gremmie@1
|
24 DATABASE_NAME = local_settings.DATABASE_NAME
|
gremmie@1
|
25 DATABASE_USER = local_settings.DATABASE_USER
|
gremmie@1
|
26 DATABASE_PASSWORD = local_settings.DATABASE_PASSWORD
|
gremmie@1
|
27 DATABASE_HOST = local_settings.DATABASE_HOST
|
gremmie@1
|
28 DATABASE_PORT = local_settings.DATABASE_PORT
|
gremmie@1
|
29
|
gremmie@1
|
30 INTERNAL_IPS = local_settings.INTERNAL_IPS
|
gremmie@1
|
31
|
gremmie@1
|
32 # Local time zone for this installation. Choices can be found here:
|
gremmie@1
|
33 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
gremmie@1
|
34 # although not all choices may be available on all operating systems.
|
gremmie@1
|
35 # If running in a Windows environment this must be set to the same as your
|
gremmie@1
|
36 # system time zone.
|
gremmie@1
|
37 TIME_ZONE = local_settings.TIME_ZONE
|
gremmie@1
|
38
|
gremmie@1
|
39 # Language code for this installation. All choices can be found here:
|
gremmie@1
|
40 # http://www.i18nguy.com/unicode/language-identifiers.html
|
gremmie@1
|
41 LANGUAGE_CODE = 'en-us'
|
gremmie@1
|
42
|
gremmie@1
|
43 SITE_ID = local_settings.SITE_ID
|
gremmie@1
|
44
|
gremmie@1
|
45 # If you set this to False, Django will make some optimizations so as not
|
gremmie@1
|
46 # to load the internationalization machinery.
|
gremmie@1
|
47 USE_I18N = False
|
gremmie@1
|
48
|
gremmie@1
|
49 # Absolute path to the directory that holds media.
|
gremmie@1
|
50 # Example: "/home/media/media.lawrence.com/"
|
gremmie@1
|
51 MEDIA_ROOT = local_settings.MEDIA_ROOT
|
gremmie@1
|
52
|
gremmie@1
|
53 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
gremmie@1
|
54 # trailing slash if there is a path component (optional in other cases).
|
gremmie@1
|
55 # Examples: "http://media.lawrence.com", "http://example.com/media/"
|
gremmie@1
|
56 MEDIA_URL = local_settings.MEDIA_URL
|
gremmie@1
|
57
|
gremmie@1
|
58 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
|
gremmie@1
|
59 # trailing slash.
|
gremmie@1
|
60 # Examples: "http://foo.com/media/", "/media/".
|
gremmie@1
|
61 ADMIN_MEDIA_PREFIX = local_settings.ADMIN_MEDIA_PREFIX
|
gremmie@1
|
62
|
gremmie@1
|
63 # Make this unique, and don't share it with anybody.
|
gremmie@1
|
64 SECRET_KEY = local_settings.SECRET_KEY
|
gremmie@1
|
65
|
gremmie@1
|
66 # List of callables that know how to import templates from various sources.
|
gremmie@1
|
67 TEMPLATE_LOADERS = (
|
gremmie@1
|
68 'django.template.loaders.filesystem.load_template_source',
|
gremmie@1
|
69 'django.template.loaders.app_directories.load_template_source',
|
gremmie@1
|
70 # 'django.template.loaders.eggs.load_template_source',
|
gremmie@1
|
71 )
|
gremmie@1
|
72
|
gremmie@1
|
73 MIDDLEWARE_CLASSES = (
|
gremmie@1
|
74 'django.middleware.common.CommonMiddleware',
|
gremmie@1
|
75 'django.contrib.sessions.middleware.SessionMiddleware',
|
gremmie@1
|
76 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
bgneal@42
|
77 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
|
gremmie@1
|
78 )
|
gremmie@1
|
79
|
gremmie@1
|
80 ROOT_URLCONF = 'gpp.urls'
|
gremmie@1
|
81
|
gremmie@1
|
82 TEMPLATE_DIRS = (
|
gremmie@1
|
83 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
gremmie@1
|
84 # Always use forward slashes, even on Windows.
|
gremmie@1
|
85 # Don't forget to use absolute paths, not relative paths.
|
gremmie@1
|
86 os.path.join(project_path, 'templates'),
|
bgneal@29
|
87 '/home/brian/coding/python/django/django-elsewhere/elsewhere/templates',
|
gremmie@1
|
88 )
|
gremmie@1
|
89
|
gremmie@1
|
90 TEMPLATE_CONTEXT_PROCESSORS = (
|
gremmie@1
|
91 "django.core.context_processors.auth",
|
gremmie@1
|
92 "django.core.context_processors.debug",
|
gremmie@1
|
93 "django.core.context_processors.request",
|
gremmie@1
|
94 "django.core.context_processors.media"
|
gremmie@1
|
95 )
|
gremmie@1
|
96
|
gremmie@1
|
97 INSTALLED_APPS = (
|
gremmie@1
|
98 'django.contrib.admin',
|
gremmie@1
|
99 'django.contrib.admindocs',
|
gremmie@1
|
100 'django.contrib.auth',
|
gremmie@1
|
101 'django.contrib.contenttypes',
|
bgneal@28
|
102 'django.contrib.humanize',
|
gremmie@1
|
103 'django.contrib.sessions',
|
gremmie@1
|
104 'django.contrib.sites',
|
gremmie@1
|
105 'django.contrib.markup',
|
bgneal@42
|
106 'django.contrib.flatpages',
|
bgneal@29
|
107 'elsewhere',
|
gremmie@1
|
108 'tagging',
|
gremmie@1
|
109 'accounts',
|
gremmie@1
|
110 'bio',
|
gremmie@1
|
111 'bulletins',
|
gremmie@1
|
112 'comments',
|
gremmie@1
|
113 'contact',
|
gremmie@1
|
114 'core',
|
bgneal@33
|
115 'donations',
|
gremmie@1
|
116 'downloads',
|
gremmie@1
|
117 'gcalendar',
|
gremmie@1
|
118 'irc',
|
gremmie@1
|
119 'membermap',
|
gremmie@1
|
120 'messages',
|
gremmie@1
|
121 'news',
|
gremmie@1
|
122 'podcast',
|
gremmie@1
|
123 'polls',
|
gremmie@1
|
124 'potd',
|
gremmie@1
|
125 'shoutbox',
|
gremmie@1
|
126 'smiley',
|
gremmie@1
|
127 'weblinks',
|
gremmie@1
|
128 )
|
gremmie@1
|
129
|
gremmie@1
|
130 LOGIN_URL = '/accounts/login/'
|
gremmie@1
|
131 LOGIN_REDIRECT_URL = '/profile/me/'
|
gremmie@1
|
132 LOGOUT_URL = '/accounts/logout/'
|
gremmie@1
|
133
|
bgneal@57
|
134 FILE_UPLOAD_PERMISSIONS = 0644
|
gremmie@1
|
135
|
gremmie@1
|
136 #######################################################################
|
bgneal@43
|
137 # Caching
|
bgneal@43
|
138 #######################################################################
|
bgneal@43
|
139 if local_settings.USE_CACHE:
|
bgneal@43
|
140 CACHE_BACKEND = local_settings.CACHE_BACKEND
|
bgneal@43
|
141 #CACHE_MIDDLEWARE_SECONDS = local_settings.CACHE_MIDDLEWARE_SECONDS
|
bgneal@43
|
142 #CACHE_MIDDLEWARE_KEY_PREFIX = local_settings.CACHE_MIDDLEWARE_KEY_PREFIX
|
bgneal@43
|
143 #CACHE_MIDDLEWARE_ANONYMOUS_ONLY = local_settings.CACHE_MIDDLEWARE_ANONYMOUS_ONLY
|
bgneal@43
|
144
|
bgneal@43
|
145 #######################################################################
|
gremmie@1
|
146 # Tagging Specific Settings
|
gremmie@1
|
147 #######################################################################
|
gremmie@1
|
148 FORCE_LOWERCASE_TAGS = True
|
gremmie@1
|
149 MAX_TAG_LENGTH = 50
|
gremmie@1
|
150
|
gremmie@1
|
151 #######################################################################
|
gremmie@1
|
152 # GPP Specific Settings
|
gremmie@1
|
153 #######################################################################
|
gremmie@1
|
154 GPP_LOG_LEVEL = 0
|
bgneal@51
|
155 GPP_SEND_EMAIL = local_settings.GPP_SEND_EMAIL
|
gremmie@1
|
156 GPP_NO_REPLY_EMAIL = 'no_reply'
|
gremmie@1
|
157 AVATAR_DIR = 'avatars'
|
gremmie@1
|
158 MAX_AVATAR_SIZE_BYTES = 2 * 1024 * 1024
|
gremmie@1
|
159 MAX_AVATAR_SIZE_PIXELS = 100
|
gremmie@1
|
160 AVATAR_DEFAULT_URL = MEDIA_URL + AVATAR_DIR + '/default.png'
|
bgneal@36
|
161
|
bgneal@36
|
162 # Donations application settings:
|
bgneal@36
|
163 DONATIONS_DEBUG = True
|
bgneal@35
|
164 DONATIONS_ITEM_NAME = 'Donation for SurfGuitar101.com'
|
bgneal@35
|
165 DONATIONS_BUSINESS = 'brian@surfguitar101.com'
|
bgneal@59
|
166 DONATIONS_BUSINESS_DEBUG = 'bgneal_1194212446_biz@gmail.com'
|
bgneal@59
|
167 DONATIONS_GOAL = Decimal('100.00') # monthly goal
|
bgneal@35
|
168 DONATIONS_ANON_NAME = u'Anonymous'
|
bgneal@60
|
169 DONATIONS_ITEM_NUM = '500' # donation w/name listed
|
bgneal@60
|
170 DONATIONS_ITEM_ANON_NUM = '501' # donation listed as anonymous
|
bgneal@6
|
171
|
bgneal@38
|
172 #######################################################################
|
bgneal@38
|
173 # Configure Logging
|
bgneal@38
|
174 #######################################################################
|
bgneal@38
|
175
|
bgneal@38
|
176 logging.basicConfig(
|
bgneal@38
|
177 filename=os.path.join(project_path, 'logs', 'gpp.log'),
|
bgneal@38
|
178 filemode='a',
|
bgneal@38
|
179 format='%(asctime)s %(levelname)s %(message)s',
|
bgneal@38
|
180 level=local_settings.LOG_LEVEL)
|
bgneal@38
|
181
|
bgneal@38
|
182
|
bgneal@38
|
183 #######################################################################
|
bgneal@6
|
184 # URL's of 3rd party Javascript and CSS files.
|
bgneal@6
|
185 # These dictionaries are used by core/templatetags/script_tags, and
|
bgneal@6
|
186 # should also be used by developers when creating form media classes.
|
bgneal@6
|
187 GPP_THIRD_PARTY_JS = {
|
bgneal@6
|
188 'jquery': (
|
bgneal@6
|
189 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js',
|
bgneal@6
|
190 ),
|
bgneal@6
|
191 'jquery-autocomplete': (
|
bgneal@6
|
192 'js/jquery-autocomplete/lib/jquery.bgiframe.min.js',
|
bgneal@6
|
193 'js/jquery-autocomplete/lib/jquery.ajaxQueue.js',
|
bgneal@6
|
194 'js/jquery-autocomplete/jquery.autocomplete.js',
|
bgneal@6
|
195 ),
|
bgneal@6
|
196 'jquery-jeditable': (
|
bgneal@6
|
197 'js/jquery.jeditable.mini.js',
|
bgneal@6
|
198 ),
|
bgneal@6
|
199 'jquery-ui': (
|
bgneal@11
|
200 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js',
|
bgneal@6
|
201 ),
|
bgneal@6
|
202 'markitup': (
|
bgneal@6
|
203 'js/markitup/jquery.markitup.pack.js',
|
bgneal@6
|
204 'js/markitup/sets/markdown/set.js',
|
bgneal@6
|
205 ),
|
bgneal@7
|
206 'tiny_mce': (
|
bgneal@7
|
207 'js/tiny_mce/tiny_mce.js',
|
bgneal@7
|
208 'js/tiny_mce_init_std.js',
|
bgneal@7
|
209 ),
|
bgneal@6
|
210 }
|
bgneal@6
|
211 GPP_THIRD_PARTY_CSS = {
|
bgneal@6
|
212 'jquery-ui': (
|
bgneal@11
|
213 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/redmond/jquery-ui.css',
|
bgneal@6
|
214 ),
|
bgneal@6
|
215 'jquery-autocomplete': (
|
bgneal@6
|
216 'js/jquery-autocomplete/jquery.autocomplete.css',
|
bgneal@6
|
217 ),
|
bgneal@6
|
218 'markitup': (
|
bgneal@6
|
219 'js/markitup/skins/markitup/style.css',
|
bgneal@6
|
220 'js/markitup/sets/markdown/style.css',
|
bgneal@6
|
221 ),
|
bgneal@6
|
222 }
|
bgneal@6
|
223
|