2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

Remove support for django-debug-toolbar (#6196)

* Remove support for django-debug-toolbar

- Will not be effective with new react interface
- Performance is too slow for use anyway

* Fix requirements-dev.txt
This commit is contained in:
Oliver
2024-01-11 07:18:20 +11:00
committed by GitHub
parent 5135d6b5d1
commit d1cc81fc9f
5 changed files with 0 additions and 33 deletions

View File

@ -372,19 +372,6 @@ if LDAP_AUTH:
AUTH_LDAP_USER_FLAGS_BY_GROUP = get_setting("INVENTREE_LDAP_USER_FLAGS_BY_GROUP", "ldap.user_flags_by_group", {}, dict)
AUTH_LDAP_FIND_GROUP_PERMS = True
DEBUG_TOOLBAR_ENABLED = DEBUG and get_setting('INVENTREE_DEBUG_TOOLBAR', 'debug_toolbar', False)
# If the debug toolbar is enabled, add the modules
if DEBUG_TOOLBAR_ENABLED: # pragma: no cover
logger.info("Running with DEBUG_TOOLBAR enabled")
INSTALLED_APPS.append('debug_toolbar')
MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware')
DEBUG_TOOLBAR_CONFIG = {
'RESULTS_CACHE_SIZE': 100,
'OBSERVE_REQUEST_CALLBACK': lambda x: False,
}
# Internal IP addresses allowed to see the debug toolbar
INTERNAL_IPS = [
'127.0.0.1',
@ -437,12 +424,6 @@ TEMPLATES = [
},
]
if DEBUG_TOOLBAR_ENABLED: # pragma: no cover
# Note that the APP_DIRS value must be set when using debug_toolbar
# But this will kill template loading for plugins
TEMPLATES[0]['APP_DIRS'] = True
del TEMPLATES[0]['OPTIONS']['loaders']
REST_FRAMEWORK = {
'EXCEPTION_HANDLER': 'InvenTree.exceptions.exception_handler',
'DATETIME_FORMAT': '%Y-%m-%d %H:%M',

View File

@ -249,13 +249,6 @@ if settings.DEBUG:
# Media file access
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
# Debug toolbar access (only allowed in DEBUG mode)
if settings.DEBUG_TOOLBAR_ENABLED:
import debug_toolbar
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
# Redirect for favicon.ico
urlpatterns.append(
path('favicon.ico', RedirectView.as_view(url=f'{settings.STATIC_URL}img/favicon/favicon.ico'))