bennett39 / django-heroku-example

Demonstration of deploying Django to Heroku
12 stars 8 forks source link

python manage.py migrate #1

Open JOFLIX opened 5 years ago

JOFLIX commented 5 years ago

On running the title above I get this error: del DATABASES['default']['OPTIONS']['sslmode'] KeyError: 'OPTIONS'

MarcoGiuliani89 commented 4 years ago

Same error for me... Does anyone solved it?

harryghgim commented 4 years ago

Same here. On local scale it works fine. It becomes problem when pushing to heroku

remote: -----> $ python manage.py collectstatic --noinput remote: Traceback (most recent call last): remote: File "manage.py", line 21, in remote: main() remote: File "manage.py", line 17, in main remote: execute_from_command_line(sys.argv) remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/init.py", line 401, in execute_from_command_line remote: utility.execute() remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/init.py", line 345, in execute remote: settings.INSTALLED_APPS remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/init.py", line 76, in getattr remote: self._setup(name) remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/init.py", line 63, in _setup remote: self._wrapped = Settings(settings_module) remote: File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/init.py", line 142, in init remote: mod = importlib.import_module(self.SETTINGS_MODULE) remote: File "/app/.heroku/python/lib/python3.7/importlib/init.py", line 127, in import_module remote: return _bootstrap._gcd_import(name[level:], package, level) remote: File "", line 1006, in _gcd_import remote: File "", line 983, in _find_and_load remote: File "", line 967, in _find_and_load_unlocked remote: File "", line 677, in _load_unlocked remote: File "", line 728, in exec_module remote: File "", line 219, in _call_with_frames_removed remote: File "/tmp/build_aa203f8af5dac49f3fe013589131dec5/django_project/settings.py", line 164, in remote: del DATABASES['default']['OPTIONS']['sslmode'] remote: KeyError: 'OPTIONS' remote: remote: ! Error while running '$ python manage.py collectstatic --noinput'. remote: See traceback above for details. remote: remote: You may need to update application code to resolve this error. remote: Or, you can disable collectstatic for this application: remote: remote: $ heroku config:set DISABLE_COLLECTSTATIC=1 remote: remote: https://devcenter.heroku.com/articles/django-assets remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to _my_gitname. remote: To https://git.heroku.com/my_git_name.git

rahul-git-09 commented 4 years ago

Check your .env file 'DATABASE_URL=sqlite:///db.sqlite3'

change this into DATABASE_URL=sqlite:///db.sqlite3

now its working...