I'd like to use PostgreSQL locally and in Heroku.
How do I set my settings.py
to know which setting to use?
I have tried to put it as an environment variable, but I still can not. Today I have this:
#Conectar localmente no sqlite
default_dburl = 'sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3')
#Se não tiver sqlite, conecta no postgres
DATABASES = { 'default': config('DATABASE_URL', default=default_dburl, cast=dburl), }