CTRL + K
Server
Settings

Settings

Background

Grai uses Django and Postgres as part of it's core stack. It supports scheduled worker management with celery and cacheing through redis. It also offers both a REST API and GraphQL API.

Configuration

Most aspects of the server are fully configurable. If there are any attributes you need greater control over PR's are welcome.

ℹī¸

The default settings for ALLOWED_HOSTS, CORS_ALLOWED_ORIGINS, CSRF_TRUSTED_ORIGINS, and CORS_ALLOW_ALL_ORIGINS are all modified by DEBUG to be maximally permissive. It will allow all hosts, all origins, and all combinations of frontend host, backend host and scheme.

environment variablerequireddefault valuedescription
DEBUGNoFalseRun in debug mode
TEMPLATE_DEBUGNoFalseRun templating in debug mode
SERVER_HOSTNolocalhosthost for the current deployment
SERVER_PORTNo8000port for the current deployment
FRONTEND_HOSTNolocalhosthost for the deployed frontend
FRONTEND_PORTNo3000port for the deployed frontend
DISABLE_HTTPNoFalsedisables access through http
ALLOWED_HOSTSNoSERVER_HOST, 127.0.0.1, [::1]disables access through http
CORS_ALLOWED_ORIGINSNohttp://{SERVER_HOST}, https://{SERVER_HOST}, http://{FRONTEND_HOST}, https://{FRONTEND_HOST}host for the current deployment
CSRF_TRUSTED_ORIGINSNoSERVER_HOST, 127.0.0.1, [::1]host for the current deployment
CORS_ALLOW_ALL_ORIGINSNoFalseDjango CORS allow all setting

Email Configuration

environment variablerequireddefault valuedescription
EMAIL_BACKENDNodjango.core.mail.backends.console.EmailBackendYour preferred email backend (opens in a new tab)
EMAIL_FROMNoNoneThe email address your emails should be sent from
AWS_ACCESS_KEY_IDNoNoneAWS access key id required for amazon SES
AWS_SECRET_ACCESS_KEYNoNoneAWS secret access key required for amazon SES
AWS_SES_REGION_NAMENoNoneAWS region required for amazon SES
AWS_SES_REGION_ENDPOINTNoemail.us-west-2.amazonaws.comThe email address your emails should be sent from

Celery Configuration

environment variablerequireddefault valuedescription
CELERY_BROKER_URLNoredis://127.0.0.1:6379/0The backend url for celery

Miscellaneous

environment variablerequireddefault valuedescription
SENTRY_DSNNoConfigure error reporting with Sentry
POSTHOG_PROJECT_API_KEYNoConfigure logging through posthog
DISABLE_TELEMETRYNoFalseDisables all telemetry
DEFAULT_FILE_STORAGENodjango.core.files.storage.FileSystemStorageThe default file storage backend used by Django
AWS_STORAGE_BUCKET_NAMENoNoneAWS bucket storage
GITHUB_APP_IDNoNone
GITHUB_PRIVATE_KEYNoNone