Skip to content

Commit

Permalink
fetch host settings from env variable (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylked authored Mar 15, 2024
1 parent d0a6db2 commit fb763c8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions api/neurona/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@

from pathlib import Path

import environ
env = environ.Env()
environ.Env.read_env()


# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

Expand All @@ -24,12 +29,9 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = env.list("ALLOWED_HOSTS")

CORS_ALLOWED_ORIGINS = [
"http://localhost:3000",
"http://127.0.0.1:3000",
]
CORS_ALLOWED_ORIGINS = env.list("CORS_ALLOWED_ORIGINS")

# Application definition

Expand Down Expand Up @@ -135,9 +137,6 @@

# Environment variables
# source : https://alicecampkin.medium.com/how-to-set-up-environment-variables-in-django-f3c4db78c55f
import environ
env = environ.Env()
environ.Env.read_env()

PASSKEY_RP_ID = env("PASSKEY_RP_ID")
PASSKEY_ORIGIN = env("PASSKEY_ORIGIN")

0 comments on commit fb763c8

Please sign in to comment.