I have a project that works on Heroku, I don't have PostgreSQL installed on my local machine. I want to keep running the app on my local machine using sqlite3
, but when I push it to Heroku it will convert to pg
All I am trying to do is to have an IF condition if this is development then run sqlite3 .. but if it's production run then following command.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '',
'HOST': '',
'PORT': 5432,
'USER': '',
'PASSWORD': ''
}
}
Heroku is working with dj_database_url
import dj_database_url
DATABASES['default'] = dj_database_url.config()
It basically similar to Rails
when we define the gems for production and another gems for testing and development.