Skip to content

Commit

Permalink
add dev options to settings + url
Browse files Browse the repository at this point in the history
  • Loading branch information
catborise committed Jul 17, 2020
1 parent 523f58b commit b5b43b7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
17 changes: 17 additions & 0 deletions webvirtcloud/settings-dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,20 @@

DEBUG = True
TEMPLATE_DEBUG = True


INSTALLED_APPS += [
'debug_toolbar',
]

MIDDLEWARE += [
'debug_toolbar.middleware.DebugToolbarMiddleware',
]

# DebugToolBar
INTERNAL_IPS = (
'127.0.0.1',
)
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
}
2 changes: 1 addition & 1 deletion webvirtcloud/settings.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = ''

DEBUG = True
DEBUG = False

ALLOWED_HOSTS = ['*']

Expand Down
12 changes: 10 additions & 2 deletions webvirtcloud/urls.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.conf import settings
from django.urls import include, path

from instances.views import index
from console.views import console
from appsettings.views import appsettings
from console.views import console
from instances.views import index

urlpatterns = [
path('', index, name='index'),
Expand All @@ -16,3 +17,10 @@
path('i18n/', include('django.conf.urls.i18n')),
path('logs/', include('logs.urls')),
]

if settings.DEBUG:
import debug_toolbar

urlpatterns += [
path('__debug__/', include(debug_toolbar.urls)),
]

0 comments on commit b5b43b7

Please sign in to comment.