0
I would like to use Postgresql locally and on Heroku.
How I set up mine settings.py
to know which configuration to use?
I’ve tried putting it as an environment variable, but I haven’t been able to. Today I have it:
#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), }