Skip to content

Commit

Permalink
add environment variable for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
maelys-buhler committed Mar 16, 2024
1 parent 7573221 commit 2403205
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ django = "==5.0.2"
djangorestframework = "==3.14.0"
pandas = "*"
django-cors-headers = "*"
python-dotenv = "*"

[dev-packages]

Expand Down
11 changes: 10 additions & 1 deletion api/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions api/masteriq/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

from pathlib import Path
import os
from dotenv import load_dotenv

load_dotenv()

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand All @@ -21,16 +24,16 @@
# 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-^=xy+akjf7r600zo6r+_5fku9!1aw)hhf_&feny8r3@6ds%rds'
SECRET_KEY = os.getenv('SECRET_KEY')

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = os.getenv('DEBUG')

ALLOWED_HOSTS = []

CORS_ALLOWED_ORIGINS = [
"http://localhost:5173",
"http://127.0.0.1:5173",
os.getenv('FRONTEND_URL'),
os.getenv('BACKEND_URL'),
]

# Application definition
Expand Down
Binary file modified api/requirements.txt
Binary file not shown.

0 comments on commit 2403205

Please sign in to comment.