Digital Ocean App Platform - Checklist

Database

This is how I have src/settings/production.py (for now):

DATABASES = {
    "default": {
        "CONN_HEALTH_CHECKS": True,
        "ENGINE": "django.db.backends.postgresql",
        "HOST": get_env_variable("DATABASE_HOST"),
        "NAME": get_env_variable("DATABASE_NAME"),
        "PASSWORD": get_env_variable("DATABASE_PASS"),
        "PORT": get_env_variable("DATABASE_PORT"),
        "USER": get_env_variable("DATABASE_USER"),
        # "OPTIONS": {
        #    "pool": True,
        # },
    }
}

Warning

Dramatiq seems to be losing it’s database connection alot. I enabled pooling, but the common error is a 30 second timeout in the pool. I will disable the pool and enable CONN_HEALTH_CHECKS to see if the Dramatiq database connections become more reliable.