Skip to content

Commit

Permalink
edit web production settings
Browse files Browse the repository at this point in the history
  • Loading branch information
kwanok committed Mar 12, 2024
1 parent 9adfff9 commit 81989d2
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions web/project/project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,27 @@
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

ENV = os.getenv("ENV", "development")


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "django-insecure-oebj&y31_9&1-f^3cdx!h$_#jya*n8-&adi-t5%b(27p@e*t0s"


# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
if ENV == "production":
DEBUG = False
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_SECONDS = 31536000 # 1 year
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_HSTS_PRELOAD = True
SECRET_KEY = os.getenv("WEB_SECRET_KEY")
else:
DEBUG = True
SECRET_KEY = "django-insecure-oebj&y31_9&1-f^3cdx!h$_#jya*n8-&adi-t5%b(27p@e*t0s"

ALLOWED_HOSTS = ["duofinder.kr", "localhost", "127.0.0.1"]

Expand Down Expand Up @@ -86,8 +98,6 @@
# Database
# https://docs.djangoproject.com/en/5.0/ref/settings/#databases

ENV = os.getenv("ENV", "development")

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
Expand Down

0 comments on commit 81989d2

Please sign in to comment.