在部署到heroku之前,我正在配置我的Django代码和db。在我通过git推送到Heroku之后,我成功安装了消息,然后是这样的。是因为我在requirements.txt中有一个旧的依赖项吗?
remote: $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 10, in <module>
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python3.5/site-packages/django/core/management/__init__.py", line 302, in execute
remote: settings.INSTALLED_APPS
remote: File "/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py", line 55, in __getattr__
remote: self._setup(name)
remote: File "/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py", line 43, in _setup
remote: self._wrapped = Settings(settings_module)
remote: File "/app/.heroku/python/lib/python3.5/site-packages/django/conf/__init__.py", line 99, in __init__
remote: mod = importlib.import_module(self.SETTINGS_MODULE)
remote: File "/app/.heroku/python/lib/python3.5/importlib/__init__.py", line 126, in import_module
remote: return _bootstrap._gcd_import(name[level:], package, level)
remote: File "<frozen importlib._bootstrap>", line 986, in _gcd_import
remote: File "<frozen importlib._bootstrap>", line 969, in _find_and_load
remote: File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
remote: File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
remote: File "<frozen importlib._bootstrap_external>", line 662, in exec_module
remote: File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
remote: File "/app/hypetroopdjango/settings.py", line 147, in <module>
remote: DATABASE['default'].update(db_from_env)
remote: NameError: name 'DATABASE' is not define
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 warm-forest-32846.
remote:
To https://git.heroku.com/warm-forest-32846.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/warm-forest-32846.git'
答案 0 :(得分:0)
我应该DATABASES
!不是DATABASE
SMH