Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit web production settings #10

Merged
merged 1 commit into from
Mar 12, 2024
Merged
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
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
Loading