diff --git a/src/open_inwoner/conf/dev.py b/src/open_inwoner/conf/dev.py index aa61344188..765ccdd118 100644 --- a/src/open_inwoner/conf/dev.py +++ b/src/open_inwoner/conf/dev.py @@ -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 diff --git a/src/open_inwoner/urls.py b/src/open_inwoner/urls.py index 820b5f6206..e5dfb17285 100644 --- a/src/open_inwoner/urls.py +++ b/src/open_inwoner/urls.py @@ -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")))