1 #@PydevCodeAnalysisIgnore |
|
2 import os.path |
|
3 #import ldtplatform |
|
4 VERSION = (0, 3, 0, "final", 0) |
|
5 VERSION_STR = unicode(".".join(map(lambda i:"%02d" % (i,), VERSION[:2]))) |
|
6 def get_version(): |
|
7 version = '%s.%s' % (VERSION[0], VERSION[1]) |
|
8 if VERSION[2]: |
|
9 version = '%s.%s' % (version, VERSION[2]) |
|
10 if VERSION[3:] == ('alpha', 0): |
|
11 version = '%s pre-alpha' % version |
|
12 else: |
|
13 if VERSION[3] != 'final': |
|
14 version = '%s %s %s' % (version, VERSION[3], VERSION[4]) |
|
15 return version |
|
16 __version__ = get_version() |
|
17 |
|
18 # Django settings for project. |
|
19 |
|
20 DEBUG = True |
|
21 TEMPLATE_DEBUG = DEBUG |
|
22 |
|
23 ADMINS = ( |
|
24 # ('Your Name', 'your_email@domain.com'), |
|
25 ) |
|
26 |
|
27 MANAGERS = ADMINS |
|
28 |
|
29 DATABASES = { |
|
30 'default': { |
|
31 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
|
32 'NAME': '', # Or path to database file if using sqlite3. |
|
33 'USER': '', # Not used with sqlite3. |
|
34 'PASSWORD': '', # Not used with sqlite3. |
|
35 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. |
|
36 'PORT': '', # Set to empty string for default. Not used with sqlite3. |
|
37 } |
|
38 } |
|
39 |
|
40 # Local time zone for this installation. Choices can be found here: |
|
41 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
|
42 # although not all choices may be available on all operating systems. |
|
43 # If running in a Windows environment this must be set to the same as your |
|
44 # system time zone. |
|
45 TIME_ZONE = 'Europe/Paris' |
|
46 |
|
47 # Language code for this installation. All choices can be found here: |
|
48 # http://www.i18nguy.com/unicode/language-identifiers.html |
|
49 LANGUAGE_CODE = 'fr-fr' |
|
50 |
|
51 ugettext = lambda s: s |
|
52 |
|
53 LANGUAGES = ( |
|
54 ('fr', ugettext('French')), |
|
55 ('en', ugettext('English')), |
|
56 ) |
|
57 |
|
58 |
|
59 SITE_ID = 1 |
|
60 |
|
61 # If you set this to False, Django will make some optimizations so as not |
|
62 # to load the internationalization machinery. |
|
63 USE_I18N = True |
|
64 |
|
65 # Absolute path to the directory that holds media. |
|
66 # Example: "/home/media/media.lawrence.com/" |
|
67 #MEDIA_ROOT = '' |
|
68 |
|
69 # Root of static files used by each app, generated by code or uploaded by users |
|
70 #STATIC_URL = '/static/' |
|
71 |
|
72 # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
|
73 # trailing slash if there is a path component (optional in other cases). |
|
74 # Examples: "http://media.lawrence.com", "http://example.com/media/" |
|
75 #MEDIA_URL = '' |
|
76 |
|
77 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
78 # trailing slash. |
|
79 # Examples: "http://foo.com/media/", "/media/". |
|
80 #ADMIN_MEDIA_PREFIX = '/media/' |
|
81 |
|
82 #LDT_MEDIA_PREFIX = '/ldt/' |
|
83 |
|
84 # Make this unique, and don't share it with anybody. |
|
85 SECRET_KEY = 't^lii5_z@tho$%6t&b#dm#t9nz$$ylyclxvkdiyqbl+(dnt(ma' |
|
86 |
|
87 # List of callables that know how to import templates from various sources. |
|
88 TEMPLATE_LOADERS = ( |
|
89 'django.template.loaders.filesystem.Loader', |
|
90 'django.template.loaders.app_directories.Loader', |
|
91 # 'django.template.loaders.eggs.Loader', |
|
92 ) |
|
93 |
|
94 MIDDLEWARE_CLASSES = ( |
|
95 'django.middleware.gzip.GZipMiddleware', |
|
96 'django.middleware.common.CommonMiddleware', |
|
97 'ldt.ldt_utils.middleware.swfupload.SWFUploadMiddleware', |
|
98 'django.contrib.sessions.middleware.SessionMiddleware', |
|
99 'django.middleware.csrf.CsrfViewMiddleware', |
|
100 'django.contrib.auth.middleware.AuthenticationMiddleware', |
|
101 #'django.middleware.locale.LocaleMiddleware', |
|
102 'django.contrib.messages.middleware.MessageMiddleware', |
|
103 'django_openid_consumer.middleware.OpenIDMiddleware', |
|
104 'ldt.ldt_utils.middleware.userprofile.LanguageMiddleware', |
|
105 ) |
|
106 |
|
107 TEMPLATE_CONTEXT_PROCESSORS = ( |
|
108 "django.core.context_processors.request", |
|
109 "django.contrib.auth.context_processors.auth", |
|
110 "django.core.context_processors.debug", |
|
111 "django.core.context_processors.i18n", |
|
112 "django.core.context_processors.media", |
|
113 "django.core.context_processors.static", |
|
114 "ldt.utils.context_processors.ldt_context", |
|
115 ) |
|
116 |
|
117 |
|
118 #ROOT_URLCONF = 'ldtplatform.urls' |
|
119 ROOT_URLCONF = 'urls' |
|
120 |
|
121 TEMPLATE_DIRS = ( |
|
122 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
|
123 # Always use forward slashes, even on Windows. |
|
124 # Don't forget to use absolute paths, not relative paths. |
|
125 os.path.join(os.path.basename(__file__), 'templates'), |
|
126 os.path.join(os.path.dirname(__file__), 'templates'), |
|
127 ) |
|
128 |
|
129 FIXTURES_DIRS = ( |
|
130 os.path.join(os.path.basename(__file__), 'fixtures'), |
|
131 ) |
|
132 |
|
133 INSTALLED_APPS = ( |
|
134 'django_extensions', |
|
135 'django.contrib.auth', |
|
136 'django.contrib.contenttypes', |
|
137 'django.contrib.sessions', |
|
138 'django.contrib.sites', |
|
139 'django.contrib.messages', |
|
140 'django.contrib.admin', |
|
141 'django.contrib.staticfiles', |
|
142 #'ldtplatform', |
|
143 'registration', |
|
144 'tagging', |
|
145 'ldt', |
|
146 'ldt.core', |
|
147 'ldt.ldt_utils', |
|
148 'ldt.text', |
|
149 'ldt.user', |
|
150 'ldt.management', |
|
151 'oauth_provider', |
|
152 'django_openid_consumer', |
|
153 'piston', |
|
154 'social_auth', |
|
155 'south', |
|
156 ) |
|
157 |
|
158 AUTH_PROFILE_MODULE = 'user.UserProfile' |
|
159 |
|
160 DECOUPAGE_BLACKLIST = ( |
|
161 "de_PPP", |
|
162 ) |
|
163 |
|
164 ZIP_BLACKLIST = ( |
|
165 "__MACOSX", |
|
166 ) |
|
167 |
|
168 AUTHENTICATION_BACKENDS = ( |
|
169 'social_auth.backends.twitter.TwitterBackend', |
|
170 'social_auth.backends.facebook.FacebookBackend', |
|
171 # 'social_auth.backends.google.GoogleOAuthBackend', |
|
172 # 'social_auth.backends.google.GoogleOAuth2Backend', |
|
173 'social_auth.backends.google.GoogleBackend', |
|
174 'social_auth.backends.yahoo.YahooBackend', |
|
175 # 'social_auth.backends.contrib.linkedin.LinkedinBackend', |
|
176 # 'social_auth.backends.contrib.LiveJournalBackend', |
|
177 # 'social_auth.backends.contrib.orkut.OrkutBackend', |
|
178 'social_auth.backends.OpenIDBackend', |
|
179 'django.contrib.auth.backends.ModelBackend', |
|
180 ) |
|
181 SOCIAL_AUTH_IMPORT_BACKENDS = ( |
|
182 'myproy.social_auth_extra_services', |
|
183 ) |
|
184 |
|
185 ACCOUNT_ACTIVATION_DAYS = 7 |
|
186 |
|
187 LDT_MAX_SEARCH_NUMBER = 50 |
|
188 LDT_JSON_DEFAULT_INDENT = 2 |
|
189 |
|
190 OAUTH_PROVIDER_KEY_SIZE = 32 |
|
191 OAUTH_PROVIDER_SECRET_SIZE = 32 |
|
192 OAUTH_PROVIDER_VERIFIER_SIZE = 10 |
|
193 OAUTH_PROVIDER_CONSUMER_KEY_SIZE = 256 |
|
194 OAUTH_AUTHORIZE_VIEW = 'oauth_provider.views.fake_authorize_view' |
|
195 OAUTH_CALLBACK_VIEW = 'oauth_provider.views.fake_callback_view' |
|
196 TEST_WEBSERVER_ADDRPORT = "127.0.0.1:8888" |
|
197 |
|
198 TWITTER_CONSUMER_KEY = 'UxAdbOLSo4Mx3CXIwDG9Eg' |
|
199 TWITTER_CONSUMER_SECRET = '2PcWgdjnJL6Vp8srB40jeAo0fjMEtDnUwmAia6EUww' |
|
200 FACEBOOK_APP_ID = '163134140411313' |
|
201 FACEBOOK_API_SECRET = 'f25e0754a44f0d90d3f4d9ea961ff012' |
|
202 |
|
203 SOCIAL_AUTH_COMPLETE_URL_NAME = 'complete' |
|
204 SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'associate_complete' |
|
205 |
|
206 # twitter testing |
|
207 TEST_TWITTER_USER = 'jacquesverrier@gmail.com' |
|
208 TEST_TWITTER_PASSWORD = '' |
|
209 |
|
210 # facebook testing |
|
211 #TEST_FACEBOOK_USER = 'testing_account' |
|
212 #TEST_FACEBOOK_PASSWORD = 'password_for_testing_account' |
|
213 |
|
214 # google testing |
|
215 TEST_GOOGLE_USER = 'jacquesverrier@gmail.com' |
|
216 TEST_GOOGLE_PASSWORD = '' |
|
217 |
|
218 AUTO_INDEX_AFTER_SAVE = True |
|
219 |
|
220 #WEB_VERSION = ldtplatform.get_version() |
|
221 WEB_VERSION = get_version() |
|
222 |
|
223 from config import * |
|
224 |
|
225 if not "LOGIN_URL" in locals(): |
|
226 LOGIN_URL = BASE_URL + 'accounts/login/' |
|
227 if not "LOGOUT_URL" in locals(): |
|
228 LOGOUT_URL = BASE_URL + 'accounts/disconnect/' |
|
229 if not "LOGIN_REDIRECT_URL" in locals(): |
|
230 LOGIN_REDIRECT_URL = BASE_URL + 'ldt/' |
|
231 if not "LOGOUT_REDIRECT_URL" in locals(): |
|
232 LOGOUT_REDIRECT_URL = BASE_URL + 'accounts/login' |
|
233 if not "PROFILE_REDIRECT_URL" in locals(): |
|
234 PROFILE_REDIRECT_URL = BASE_URL + 'auth_accounts/create/profile' |
|
235 |
|
236 if not "LOGIN_ERROR_URL" in locals(): |
|
237 LOGIN_ERROR_URL = BASE_URL + 'accounts/login' |
|
238 |
|
239 if not "GLOBAL_LOG_LEVEL" in locals(): |
|
240 GLOBAL_LOG_LEVEL = LOG_LEVEL |
|
241 if not "GLOBAL_LOG_HANDLERS" in locals(): |
|
242 GLOBAL_LOG_HANDLERS = [{'handler':logging.FileHandler(LOG_FILE), 'format':"%(asctime)s - %(levelname)s : %(message)s"}] |
|
243 |
|
244 # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
|
245 # trailing slash. |
|
246 # Examples: "http://foo.com/media/", "/media/". |
|
247 if not "ADMIN_MEDIA_PREFIX" in locals(): |
|
248 ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/' |
|
249 # Used in a lot of templates |
|
250 if not "LDT_MEDIA_PREFIX" in locals(): |
|
251 LDT_MEDIA_PREFIX = STATIC_URL + 'ldt/' |
|
252 # URL that handles the media served from MEDIA_ROOT. |
|
253 if not "MEDIA_URL" in locals(): |
|
254 MEDIA_URL = BASE_URL + 'static/media/' |
|
255 |
|