-
Notifications
You must be signed in to change notification settings - Fork 1
Environment variables
Some environment variables must be set before using the app. You can store them in an .env
file with the following format :
SOME_KEY=some_value
When using the docker-compose file to deploy the app in local, there is no need to create environment variable!
The environment variables files must never be tracked by git !
The file must be on the same directory as the settings.py
file, like neurona/api/neurona/.env
key : PASSKEY_RP_ID
default value : None
The value must represent the relying party ID.
key : PASSKEY_ORIGIN
default value : None
The origin must match the passkey authentication requests origin
key : ALLOWED_HOSTS
default value : None
The variable must match the API server possible addresses. Each host is separated with a comma.
If there is only one host, the value must end with a comma, like : ALLOWED_HOST=localhost,
key : CORS_ALLOWED_ORIGINS
default value : None
The variable must match the frontend server possible origins, including protocol and port. Each origin is separated with a comma.
If there is only one origin, the value must end with a comma, like : CORS_ALLOWED_ORIGINS=http://localhost:3000,
If you want to see debug logs when making requests to the API, set the debug mode to True
:
key : DEBUG
default value : False
If you don't want to use SQLite, you can specify the parameters to use to connect to another database, for example PostGreSQL. You'll need to specify the following variables (in parenthesis, you'll find the parameters to use with the given docker-compose file).
-
DATABASE_ENGINE
(django.db.backends.postgresql
) -
DATABASE_HOST
(neurona_db_service
) -
DATABASE_PORT
(5432
) -
DATABASE_NAME
(neurona
) -
DATABASE_USER
(neurona
) -
DATABASE_PASSWORD
(password
)
PASSKEY_RP_ID=localhost
PASSKEY_ORIGIN=localhost:3000
ALLOWED_HOSTS=localhost,
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
DEBUG=True
The file must be located in the same directory as the package.json
file, like neurona/frontend/.env
key : VITE_API_URL
default value : http://localhost:8000/api
The value represents the API URL.
VITE_API_URL=http://localhost:8000/api