diff --git a/webvirtcloud/settings-dev.py b/webvirtcloud/settings-dev.py index dec7522..5f0b595 100644 --- a/webvirtcloud/settings-dev.py +++ b/webvirtcloud/settings-dev.py @@ -9,3 +9,20 @@ from webvirtcloud.settings import * 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, +} \ No newline at end of file diff --git a/webvirtcloud/settings.py.template b/webvirtcloud/settings.py.template index 4606cac..f31e7dd 100644 --- a/webvirtcloud/settings.py.template +++ b/webvirtcloud/settings.py.template @@ -10,7 +10,7 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SECRET_KEY = '' -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['*'] diff --git a/webvirtcloud/urls.py b/webvirtcloud/urls.py index b32eb36..a2e14a8 100644 --- a/webvirtcloud/urls.py +++ b/webvirtcloud/urls.py @@ -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'), @@ -16,3 +17,10 @@ urlpatterns = [ 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)), + ]