Skip to content

Commit

Permalink
🔧 Setup silk profiling for case detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbal committed Jan 15, 2024
1 parent 4b68b0a commit 4f5c432
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/open_inwoner/conf/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@
# 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
SILKY_DYNAMIC_PROFILING = [{
'module': 'open_inwoner.cms.cases.views.status',
'function': 'InnerCaseDetailView.dispatch',
"name": "InnerCaseDetailView",
}]

# 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 @@ -192,3 +192,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 4f5c432

Please sign in to comment.