[Answered ]-How can I change the database time-out period in django?

1👍

What you’re looking for it CONN_MAX_AGE:

https://docs.djangoproject.com/en/dev/ref/settings/#conn-max-age

For example:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '5432',
        'CONN_MAX_AGE': 30,
    }
}

Leave a comment