Skip to content
Draft
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
2 changes: 2 additions & 0 deletions django/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ export RCLONE_CONFIG="path_to_rclone_config_file"
# Review apps
export SUPABASE_PROJECT_ID=""
export SUPABASE_ACCESS_TOKEN=""

export SILK_PROFILE_ENABLED=True
9 changes: 9 additions & 0 deletions django/core/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
"django.template.context_processors.debug"
)

SILKY_ENABLED = env.str("SILK_PROFILE_ENABLED", default="False")

if SILKY_ENABLED == "True":
SILKY_PYTHON_PROFILER = True
SILKY_PYTHON_PROFILER_BINARY = True
INSTALLED_APPS.append("silk")
MIDDLEWARE.append("silk.middleware.SilkyMiddleware")


# Don't use json formatter in dev
del LOGGING["handlers"]["console"]["formatter"]

Expand Down
3 changes: 3 additions & 0 deletions django/core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@
if "django_browser_reload" in settings.INSTALLED_APPS:
urls.append(path("__reload__/", include("django_browser_reload.urls")))

if "silk" in settings.INSTALLED_APPS:
urls.append(path("silk/", include("silk.urls", namespace="silk")))

urlpatterns = [*urls, *urlpatterns]
1 change: 1 addition & 0 deletions django/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dev = [
"pytest-django",
"ruff",
"pre-commit>=4.3.0", # https://github.com/pre-commit/pre-commit
"django-silk>=5.4.3",
]

[tool.pytest.ini_options]
Expand Down
25 changes: 25 additions & 0 deletions django/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.