Skip to content

Commit 003c1f6

Browse files
dragoneeclaude
andauthored
chore: upgrade django-debug-toolbar to 6.0.0 (#139)
Co-authored-by: Claude <[email protected]>
1 parent 3fd610b commit 003c1f6

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- 'docker/**'
99
- '**.md'
1010
- 'tasks/apps/tree/tests/**'
11+
- 'tasks/settings/local.py'
12+
- 'requirements/local.txt'
13+
- 'requirements/test.txt'
1114

1215
jobs:
1316
deploy:

requirements/local.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-r base.txt
2-
django-debug-toolbar==4.4.6
2+
django-debug-toolbar==6.0.0
33
factory_boy==2.12.0
44
pytest==5.3.2
55
pytest-django==3.7.0

tasks/settings/local.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import os, sys
22

33
DATABASES = {
44
'default': {
@@ -22,13 +22,18 @@
2222

2323
DEBUG = True
2424

25-
INSTALLED_APPS += ('debug_toolbar',)
25+
is_running_tests = 'test' in sys.argv or os.environ.get("PYTEST_VERSION") is not None
2626

27-
DEBUG_TOOLBAR_PATCH_SETTINGS = False
27+
if not is_running_tests:
28+
INSTALLED_APPS += ('debug_toolbar',)
29+
MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware'] + MIDDLEWARE
30+
DEBUG_TOOLBAR_PATCH_SETTINGS = False
31+
DEBUG_TOOLBAR_CONFIG = {
32+
'SHOW_TOOLBAR_CALLBACK': lambda _request: DEBUG,
33+
}
2834

29-
VALIDATE_FRONT_PASSWORD = False
3035

31-
MIDDLEWARE = ['debug_toolbar.middleware.DebugToolbarMiddleware', ] + MIDDLEWARE
36+
VALIDATE_FRONT_PASSWORD = False
3237

3338
STATICFILES_DIRS = [
3439
os.path.join(BASE_DIR, 'static', 'local')
@@ -45,4 +50,4 @@
4550
'127.0.0.1'
4651
]
4752

48-
CELERY_BROKER_URL = 'redis://tasks-queue'
53+
CELERY_BROKER_URL = 'redis://tasks-queue'

0 commit comments

Comments
 (0)