DDARE Docs
Backend

Backend Configuration

Django, Redis, database, provider key, MCP, and observability settings.

Every environment variable consumed by the DARE backend, with type, default, and description. Variables are loaded from .env at startup via config/env.py.

A working template lives at .example.env — copy it to .env and edit.


Django Core

VariableTypeDefaultDescription
DJANGO_SETTINGS_MODULEstringconfig.settings.localSettings module to load. Use config.settings.production in prod.
DJANGO_SECRET_KEYstring(required)Django secret key. Rotate this from the example value before any non-local use.
DJANGO_DEBUGboolFalseEnables debug responses and the Django debug toolbar. Must be False in production.
ENVIRONMENTstringlocalFree-form environment label (local, staging, production). Used in logs and Sentry tags.
SITE_IDint1Django sites framework site ID.
ALLOWED_HOSTScsv127.0.0.1,localhostComma-separated hostnames Django will serve.
CORS_ALLOWED_ORIGINScsv(none)Comma-separated origins permitted to make CORS requests.
CSRF_TRUSTED_ORIGINScsv(none)Comma-separated origins trusted for CSRF-protected POSTs.

Database

VariableTypeDefaultDescription
USE_POSTGRESboolFalseWhen True, connect to Postgres using DB_* below. When False, use SQLite at dare_local.db.
DB_NAMEstring(empty)Postgres database name.
DB_USERstringpostgresPostgres user.
DB_PASSWORDstring(empty)Postgres password.
DB_HOSTstringlocalhostPostgres host.
DB_PORTstring5432Postgres port.

Redis & Background Jobs

VariableTypeDefaultDescription
REDIS_HOSTstringlocalhostRedis server host. Used by Django RQ and Channels.
REDIS_PORTint6379Redis server port.
REDIS_DBint0Redis logical database number.
REDIS_PASSWORDstring(none)Redis password, if AUTH is enabled.

LLM Provider Keys

At least one provider key should be set. Missing keys disable the corresponding provider but do not block startup.

VariableTypeDefaultDescription
OPENAI_API_KEYstring(none)OpenAI API key (sk-...). Required for GPT models.
CLAUDE_API_KEYstring(none)Anthropic API key (sk-ant-...). Required for Claude models.
GEMINI_API_KEYstring(none)Google AI API key. Required for Gemini models.
OLLAMA_HOSTurlhttp://localhost:11434Ollama server URL for self-hosted LLaMA models.

Vector Stores

DARE supports both Pinecone (managed) and Weaviate (self-hosted). Either or both can be configured; users choose at runtime via preferences.

Pinecone

VariableTypeDefaultDescription
PINECONE_API_KEYstring(none)Pinecone API key.
PINECONE_INDEX_NAMEstring(none)Pinecone index to read/write document embeddings.

Weaviate

VariableTypeDefaultDescription
WEAVIATE_HOSTstringlocalhostWeaviate server host.
WEAVIATE_PORTint8080Weaviate REST port.
WEAVIATE_COLLECTION_NAMEstringDocumentCollection (class) name for stored embeddings.
WEAVIATE_SKIP_INIT_CHECKSboolTrueSkip startup connectivity checks.
WEAVIATE_AUTOSCHEMA_ENABLEDboolFalseAllow Weaviate to auto-create schema (not recommended for prod).
  • RAG_GRAPH_EXPAND_ENABLED (default true): in Advanced RAG on the document path, follow stored in-document references ("see section 7.2") one hop from each retrieved chunk before reranking. Set to false to disable the expand stage without touching ingest.
  • RAG_ENTITY_NER_ENABLED (default true): run the GLiNER named-entity lane at ingest alongside the regex identifier lane. Set to false to turn it off; identifiers still run.
  • RAG_ENTITY_MODEL (default urchade/gliner_small-v2.1): the GLiNER checkpoint used by the NER lane, loaded lazily on first use.
  • RAG_ENTITY_HOPS_ENABLED (default true): in Advanced RAG, when at least two files are selected, follow a hit's rarest shared entity into one chunk of another selected file during the expand stage.

Email

VariableTypeDefaultDescription
EMAIL_BACKENDstringdjango.core.mail.backends.console.EmailBackendDjango email backend. Use django.core.mail.backends.smtp.EmailBackend in prod.
EMAIL_HOSTstring(none)SMTP host.
EMAIL_PORTint587SMTP port.
EMAIL_HOST_USERstring(none)SMTP username.
EMAIL_HOST_PASSWORDstring(none)SMTP password.
EMAIL_FROMstring(none)Default From: address for outbound mail.
EMAIL_USE_TLSboolFalseNegotiate TLS via STARTTLS (port 587).
EMAIL_USE_SSLboolFalseUse TLS from connect (port 465). Mutually exclusive with EMAIL_USE_TLS.

Cross-Platform URLs

Used for unified authentication, password-reset emails, and inter-service callbacks.

VariableTypeDefaultDescription
FRONTEND_CONFIRM_EMAIL_URLurl(none)Base URL for email-confirmation links.
FRONTEND_PASSWORD_RESET_URLurl(none)Base URL for password-reset links.
DARE_FRONTEND_URLurl(none)Public URL of the DARE frontend.
DARE_BACKEND_URLurl(none)Public URL of this backend.
SOCRATIC_BOTS_FRONTEND_URLurl(none)Partner platform frontend URL (optional).
SOCRATIC_BOTS_BACKEND_URLurl(none)Partner platform backend URL (optional).
DARE_INTERNAL_KEYstringlocal-dev-internal-keyShared secret for partner backends calling internal endpoints. Rotate in production.

Observability

VariableTypeDefaultDescription
SENTRY_DSNurl(none)Sentry DSN. Empty disables Sentry reporting.

MCP (Model Context Protocol)

VariableTypeDefaultDescription
MCP_USE_DOCKERboolFalseWhen True, MCP servers are launched in Docker containers; otherwise as subprocesses.

SyftBox

SyftBox integration for federated data sharing.

VariableTypeDefaultDescription
SYFTBOX_ENABLEDboolFalseEnable SyftBox sync.
SYFTBOX_DATASITES_ROOTpath(none)Root path for local SyftBox datasites.
SYFTBOX_APP_NAMEstringdareApp name registered with SyftBox.
SYFTBOX_BASE_URLurlhttps://syftbox.netSyftBox base URL.
SYFTBOX_SYNC_INTERVAL_SECONDSint300Sync interval in seconds.

Adding a new variable

  1. Add the variable to .example.env with a placeholder or default.

  2. Add it to your local .env.

  3. Declare it in config/env.py:

    MY_VAR = os.getenv("MY_VAR", "default_value")
  4. Import where needed:

    from config import env
    value = env.MY_VAR
  5. Document it in this file.

Validating configuration

A quick check after editing .env:

python manage.py check
python manage.py shell -c "from config import env; print(env.OPENAI_API_KEY[:7])"

On this page