1👍
On heroku your database does not run on localhost, but somewhere in the cloud.
Heroku exposes the postgres connection URL as DATABASE_URL
in the environment variables (check heroku config
).
You can use the dj_database_url
package from kenneth reitz to auto parse it to django settings:
import dj_database_url
DATABASES = {
'default': dj_database_url.config()
}
Source:stackexchange.com