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 variable | required | default value | description |
---|---|---|---|
DEBUG | No | False | Run in debug mode |
TEMPLATE_DEBUG | No | False | Run templating in debug mode |
SERVER_HOST | No | localhost | host for the current deployment |
SERVER_PORT | No | 8000 | port for the current deployment |
FRONTEND_HOST | No | localhost | host for the deployed frontend |
FRONTEND_PORT | No | 3000 | port for the deployed frontend |
DISABLE_HTTP | No | False | disables access through http |
ALLOWED_HOSTS | No | SERVER_HOST, 127.0.0.1, [::1] | disables access through http |
CORS_ALLOWED_ORIGINS | No | http://{SERVER_HOST}, https://{SERVER_HOST}, http://{FRONTEND_HOST}, https://{FRONTEND_HOST} | host for the current deployment |
CSRF_TRUSTED_ORIGINS | No | SERVER_HOST, 127.0.0.1, [::1] | host for the current deployment |
CORS_ALLOW_ALL_ORIGINS | No | False | Django CORS allow all setting |
Email Configuration
environment variable | required | default value | description |
---|---|---|---|
EMAIL_BACKEND | No | django.core.mail.backends.console.EmailBackend | Your preferred email backend (opens in a new tab) |
EMAIL_FROM | No | None | The email address your emails should be sent from |
AWS_ACCESS_KEY_ID | No | None | AWS access key id required for amazon SES |
AWS_SECRET_ACCESS_KEY | No | None | AWS secret access key required for amazon SES |
AWS_SES_REGION_NAME | No | None | AWS region required for amazon SES |
AWS_SES_REGION_ENDPOINT | No | email.us-west-2.amazonaws.com | The email address your emails should be sent from |
Celery Configuration
environment variable | required | default value | description |
---|---|---|---|
CELERY_BROKER_URL | No | redis://127.0.0.1:6379/0 | The backend url for celery |
Miscellaneous
environment variable | required | default value | description |
---|---|---|---|
SENTRY_DSN | No | Configure error reporting with Sentry | |
POSTHOG_PROJECT_API_KEY | No | Configure logging through posthog | |
DISABLE_TELEMETRY | No | False | Disables all telemetry |
DEFAULT_FILE_STORAGE | No | django.core.files.storage.FileSystemStorage | The default file storage backend used by Django |
AWS_STORAGE_BUCKET_NAME | No | None | AWS bucket storage |
GITHUB_APP_ID | No | None | |
GITHUB_PRIVATE_KEY | No | None |