[Answer]-Django TypeError Using Heroku

1👍

Why aren’t you using dj-database-url?

It makes this so much easier:

import dj_database_url

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

It automatically looks for and parses the value in env['DATABASE_URL'], falling back to what you pass into default.

It’s what Heroku actually recommends you use.

Leave a comment