Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add silk profiler #1437

Merged
merged 2 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# http://whitenoise.evans.io/en/latest/django.html#using-whitenoise-in-development
INSTALLED_APPS = ["whitenoise.runserver_nostatic"] + INSTALLED_APPS # noqa F405

# django-silk
# ------------------------------------------------------------------------------
# https://github.com/jazzband/django-silk#requirements
INSTALLED_APPS += ["silk"] # noqa F405
MIDDLEWARE += ["silk.middleware.SilkyMiddleware"] # noqa F405
# https://github.com/jazzband/django-silk#profiling
SILKY_PYTHON_PROFILER = True

# django-debug-toolbar
# ------------------------------------------------------------------------------
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
Expand Down
5 changes: 3 additions & 2 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@
path("500/", default_views.server_error),
]
if "debug_toolbar" in settings.INSTALLED_APPS:
import debug_toolbar
urlpatterns += [path("__debug__/", include("debug_toolbar.urls"))]

urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns
if "silk" in settings.INSTALLED_APPS:
urlpatterns += [path("silk/", include("silk.urls", namespace="silk"))]

if settings.DEBUG or not settings.IS_PRODUCTION:
urlpatterns += [
Expand Down
1 change: 1 addition & 0 deletions requirements/local.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Werkzeug==2.3.6 # https://werkzeug.palletsprojects.com/en/latest/changes/
# ------------------------------------------------------------------------------
django-debug-toolbar==4.1 # https://github.com/jazzband/django-debug-toolbar/releases
django-extensions==3.2.3 # https://github.com/django-extensions/django-extensions/blob/main/CHANGELOG.md
django-silk==5.0.3 # https://github.com/jazzband/django-silk/blob/master/CHANGELOG.md

# Code quality
# ------------------------------------------------------------------------------
Expand Down