From c52eb18fc3ce4cd2721e63e49954e129855497aa Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Tue, 27 Feb 2024 17:30:30 +0330 Subject: [PATCH] fix: set JSONRenderer as the DEFAULT_RENDERER_CLASSES in production environments, it's not the best practice to have a browsable API and normally only a json should be returned. Close #34 --- tutornotes/templates/notes/apps/settings/tutor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tutornotes/templates/notes/apps/settings/tutor.py b/tutornotes/templates/notes/apps/settings/tutor.py index 18e0623..95deb9c 100644 --- a/tutornotes/templates/notes/apps/settings/tutor.py +++ b/tutornotes/templates/notes/apps/settings/tutor.py @@ -46,4 +46,7 @@ }, } +{%- if ENABLE_HTTPS %} +REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"] = ("rest_framework.renderers.JSONRenderer",) +{%- endif %} {{ patch("notes-settings") }}