Skip to content

Commit

Permalink
🔧 Setup silk profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Feb 8, 2024
1 parent 697c7d5 commit a771daf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/open_inwoner/conf/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
# playwright multi browser
PLAYWRIGHT_MULTI_ONLY_DEFAULT = True

if config("PROFILE", default=False):
INSTALLED_APPS += ["silk"]
MIDDLEWARE = ["silk.middleware.SilkyMiddleware"] + MIDDLEWARE
SILKY_PYTHON_PROFILER = True
SILKY_PYTHON_PROFILER_BINARY = True

# Override settings with local settings.
try:
from .local import * # noqa
Expand Down
3 changes: 3 additions & 0 deletions src/open_inwoner/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,6 @@
urlpatterns = [
path("__debug__/", include(debug_toolbar.urls)),
] + urlpatterns

if apps.is_installed("silk"):
urlpatterns.insert(0, path(r"silk/", include("silk.urls", namespace="silk")))

0 comments on commit a771daf

Please sign in to comment.