Skip to content
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
10 changes: 10 additions & 0 deletions backend/code_review_backend/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
"DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination",
}

# Internal Ips where django debug toolbar is enabled
INTERNAL_IPS = ["127.0.0.1"]

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/
Expand All @@ -155,6 +157,9 @@
# Enable GZip and cache, and build a manifest during collectstatic
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"

# Collect static in production mode
DEBUG = False


# Internal logging setup
LOGGING = {
Expand Down Expand Up @@ -224,3 +229,8 @@

else:
logger.info("Skipping taskcluster configuration")

# Activate django debug toolbar on debug only
if DEBUG:
INSTALLED_APPS.append("debug_toolbar")
MIDDLEWARE.append("debug_toolbar.middleware.DebugToolbarMiddleware")
6 changes: 6 additions & 0 deletions backend/code_review_backend/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from django.conf import settings
from django.contrib import admin
from django.shortcuts import redirect
from django.urls import include
Expand All @@ -15,3 +16,8 @@
path("v1/", include(api.urls)),
path("admin/", admin.site.urls),
]

if settings.DEBUG:
import debug_toolbar

urlpatterns += [path("__debug__/", include(debug_toolbar.urls))]
1 change: 1 addition & 0 deletions backend/requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
django-debug-toolbar==2.0
pre-commit==1.18.3