Skip to content

Commit 8ef2200

Browse files
committed
Refactored settings
1 parent 5ebc2cb commit 8ef2200

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

fosstack/settings.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@
3232

3333
# Application definition
3434

35+
THIRD_PARTY_PREPEND = (
36+
'jet', # App that should be apper before other apps
37+
)
38+
3539
INTERNAL_APPS = (
36-
'jet',
3740
'django.contrib.admin',
3841
'django.contrib.auth',
3942
'django.contrib.contenttypes',
@@ -46,22 +49,20 @@
4649

4750
THIRD_PARTY_APPS = (
4851
'crispy_forms',
49-
'debug_toolbar',
5052
'django_extensions',
5153
'disqus',
5254
'filebrowser',
5355
'mptt',
56+
'taggit',
5457
'tinymce',
5558
'widget_tweaks',
56-
'taggit',
5759
)
5860

5961
PROJECT_APPS = (
60-
'core_blog',
6162
'back_office',
63+
'core_blog',
6264
)
6365

64-
INSTALLED_APPS = INTERNAL_APPS + THIRD_PARTY_APPS + PROJECT_APPS
6566

6667
MIDDLEWARE = [
6768
'django.middleware.security.SecurityMiddleware',
@@ -71,7 +72,6 @@
7172
'django.contrib.auth.middleware.AuthenticationMiddleware',
7273
'django.contrib.messages.middleware.MessageMiddleware',
7374
'django.middleware.clickjacking.XFrameOptionsMiddleware',
74-
'debug_toolbar.middleware.DebugToolbarMiddleware',
7575
]
7676

7777
ROOT_URLCONF = 'fosstack.urls'
@@ -195,3 +195,11 @@
195195

196196
TAGGIT_CASE_INSENSITIVE = True # taggit
197197
CRISPY_TEMPLATE_PACK = 'bootstrap4' # Crispy form
198+
199+
if DEBUG:
200+
THIRD_PARTY_APPS += ('debug_toolbar',)
201+
MIDDLEWARE += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
202+
203+
INSTALLED_APPS = (
204+
THIRD_PARTY_PREPEND + INTERNAL_APPS + THIRD_PARTY_APPS + PROJECT_APPS
205+
)

0 commit comments

Comments
 (0)