From dc859f15f2da1bd62c4d694534feea6e9046d772 Mon Sep 17 00:00:00 2001 From: acidburnmonkey Date: Wed, 6 Aug 2025 01:22:35 -0400 Subject: [PATCH] changed project key to .env and updated readme --- README.md | 17 +++++++++++++++++ mysite/settings.py | 5 ++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e69de29..c1a27d9 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,17 @@ +# Build + +To update js script + +``` +rm scripts.js && tsc scripts.ts +``` + +# Before prod , this need to be on settings.py + +```python +REST_FRAMEWORK = { + 'DEFAULT_RENDERER_CLASSES': [ + 'rest_framework.renderers.JSONRenderer', + ], +} +``` diff --git a/mysite/settings.py b/mysite/settings.py index f4121e0..492775f 100644 --- a/mysite/settings.py +++ b/mysite/settings.py @@ -11,6 +11,8 @@ https://docs.djangoproject.com/en/5.2/ref/settings/ """ from pathlib import Path +import os +from dotenv import load_dotenv # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -20,7 +22,8 @@ BASE_DIR = Path(__file__).resolve().parent.parent # See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'django-insecure-jl%+_1sb3!uvg#1(jdk-q9bhu&4b*n(xy+$cz4n43gnl@=fx*_' +load_dotenv() +SECRET_KEY = os.getenv('DJANGO_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True