From 0e02573e9f789dc358d3f98bb543c8167b38d2f7 Mon Sep 17 00:00:00 2001 From: keannu125 Date: Wed, 29 Mar 2023 19:42:35 +0800 Subject: [PATCH] Switch to production to prepare for deployment and merge to master --- project/config/settings.py | 2 +- project/notes/views.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/project/config/settings.py b/project/config/settings.py index 30edc1c..5922d7a 100644 --- a/project/config/settings.py +++ b/project/config/settings.py @@ -26,7 +26,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['lemeow125.github.io', 'keannu126.pythonanywhere.com', '127.0.0.1', 'localhost'] diff --git a/project/notes/views.py b/project/notes/views.py index 4b475ff..9dbb0f3 100644 --- a/project/notes/views.py +++ b/project/notes/views.py @@ -5,7 +5,7 @@ from .models import Note class NoteViewSet(viewsets.ModelViewSet): - # permission_classes = [IsAuthenticated] + permission_classes = [IsAuthenticated] serializer_class = NoteSerializer queryset = Note.objects.all() @@ -19,6 +19,5 @@ class NoteViewSet(viewsets.ModelViewSet): class PublicNoteViewSet(generics.ListAPIView): - # permission_classes = [IsAuthenticated] serializer_class = NoteSerializer queryset = Note.objects.filter(public=True)