When I change my setting of Database according to the official guide as
DATABASES['default'] = dj_database_url.config()
It has
NameError: name 'DATABASES' is not defined
when building.
When I change the syntax of database settings to
DATABASES = {
'default': dj_database_url.config()
},
it has
settings.DATABASES is improperly configured. Please supply the ENGINE value. Check settings documentation for more details. when opening the app locally.
and it has
Internal Server Error: The server encountered an unexpected internal server error (generated by waitress)
when launching from heroku.
Notice, this way worked once. But when i merge my code with my friends, it has problem again. I roughly located it was database problem. So i delete the database on heroku and wanted to sync again. But when I sync the database, it has Import error: No module named events.
When I change the setting back to the original way:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(PROJECT_PATH, 'db.sqlite3'),
}
}
It can work locally(of course), but can't in the heroku, with the error of Import error: No module named events too when syncing the database.
PS: 1, I made sure that Heroku installed all the requirements I need to run the app, especially i triple checked all the files: models, views, urls, etc. 2, I use waitress as the server instead of gunicorn recommended by the Heroku official guide.
How can I fix it?