2

I'm using Heroku with Django.

The database is configured in settings.py this way, using the dj-database-url module:

DATABASES = {'default': dj_database_url.config()}

How can I do to add additional parameters, for example ATOMIC_REQUESTS? In a "normal" case I would do like this:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'mydatabase',
        'USER': 'mydatabaseuser',
        'PASSWORD': 'mypassword',
        'HOST': '127.0.0.1',
        'PORT': '5432',
        'ATOMIC_REQUESTS': True,
    }
}

1 Answer 1

5

DATABASES is just a dictionary: you can add the relevant settings after the initial configuration.

DATABASES = {'default': dj_database_url.config()}
DATABASES['default']['ATOMIC_REQUESTS'] = True
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.