~julian-edwards/maas/mipf-celery-job

« back to all changes in this revision

Viewing changes to src/maas/settings.py

  • Committer: Tarmac
  • Author(s): Raphael Badin
  • Date: 2012-03-02 11:00:48 UTC
  • mfrom: (197.2.8 settings-cleanup)
  • Revision ID: ed@carob-20120302110048-nz71y6zr371bd3be
[r=jtv][bug=][author=rvb] Add packaging templates.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
django.template.add_to_builtins('django.templatetags.future')
21
21
 
 
22
DEBUG = False
 
23
 
 
24
# Used to set a prefix in front of every URL.
 
25
FORCE_SCRIPT_NAME = None
 
26
 
 
27
# Allow the user to override DEBUG and FORCE_SCRIPT_NAME in
 
28
# maas_local_settings.
 
29
try:
 
30
    from maas_local_settings import DEBUG, FORCE_SCRIPT_NAME
 
31
except ImportError:
 
32
    pass
 
33
 
22
34
ADMINS = (
23
35
    # ('Your Name', 'your_email@example.com'),
24
36
)
30
42
 
31
43
LOGOUT_URL = '/'
32
44
LOGIN_REDIRECT_URL = '/'
 
45
LOGIN_URL = '/accounts/login/'
 
46
 
 
47
if FORCE_SCRIPT_NAME is not None:
 
48
    LOGOUT_URL = FORCE_SCRIPT_NAME + LOGOUT_URL
 
49
    LOGIN_REDIRECT_URL = FORCE_SCRIPT_NAME + LOGIN_REDIRECT_URL
 
50
    LOGIN_URL = FORCE_SCRIPT_NAME + LOGIN_URL
 
51
    # ADMIN_MEDIA_PREFIX will be deprecated in Django 1.4.
 
52
    # Admin's media will be served using staticfiles instead.
 
53
    ADMIN_MEDIA_PREFIX = FORCE_SCRIPT_NAME
33
54
 
34
55
API_URL_REGEXP = '^/api/1[.]0/'
35
56
METADATA_URL_REGEXP = '^/metadata/'
39
60
# maasserver.middleware.APIErrorsMiddleware)
40
61
PISTON_DISPLAY_ERRORS = False
41
62
 
42
 
DEBUG = False
43
 
 
44
 
# Allow the user to override DEBUG in local_settings.
45
 
try:
46
 
    from local_settings import DEBUG
47
 
except:
48
 
    pass
49
 
 
50
63
TEMPLATE_DEBUG = DEBUG
51
64
YUI_DEBUG = DEBUG
52
65
YUI_VERSION = '3.4.1'
113
126
# URL prefix for static files.
114
127
# Example: "http://media.lawrence.com/static/"
115
128
STATIC_URL = '/static/'
 
129
if FORCE_SCRIPT_NAME is not None:
 
130
    STATIC_URL = FORCE_SCRIPT_NAME + STATIC_URL
116
131
 
117
132
# URL prefix for admin static files -- CSS, JavaScript and images.
118
133
# Make sure to use a trailing slash.
119
134
# Examples: "http://foo.com/static/admin/", "/static/admin/".
120
135
ADMIN_MEDIA_PREFIX = '/static/admin/'
 
136
if FORCE_SCRIPT_NAME is not None:
 
137
    ADMIN_MEDIA_PREFIX = FORCE_SCRIPT_NAME + ADMIN_MEDIA_PREFIX
121
138
 
122
139
# Additional locations of static files
123
140
STATICFILES_DIRS = (
185
202
    'django.contrib.sites',
186
203
    'django.contrib.messages',
187
204
    'django.contrib.staticfiles',
188
 
    'django.contrib.admin',
189
205
    'maasserver',
190
206
    'metadataserver',
191
207
    'piston',
193
209
    # 'django.contrib.admindocs',
194
210
)
195
211
 
 
212
if DEBUG:
 
213
    INSTALLED_APPS += (
 
214
        'django.contrib.admin',
 
215
        'django.contrib.admindocs',
 
216
    )
196
217
# A sample logging configuration. The only tangible logging
197
218
# performed by this configuration is to send an email to
198
219
# the site admins on every HTTP 500 error.
221
242
PSERV_URL = None
222
243
 
223
244
try:
224
 
    from local_settings import * # NOQA
225
 
except:
 
245
    from maas_local_settings import * # NOQA
 
246
except ImportError:
226
247
    pass