我有一个Django项目,我正试图推进到heroku。我的requirements.txt文件是
Django==1.11.18
django-cms==3.5.3
django-sekizai==0.10.0
django-treebeard==4.3
djangocms-admin-style==1.2.9当我试图部署到heroku时,会出现以下错误:
remote: -----> $ python manage.py collectstatic --noinput
remote: Traceback (most recent call last):
remote: File "manage.py", line 22, in <module>
remote: execute_from_command_line(sys.argv)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
remote: utility.execute()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
remote: django.setup()
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
remote: apps.populate(settings.INSTALLED_APPS)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
remote: app_config = AppConfig.create(entry)
remote: File "/app/.heroku/python/lib/python2.7/site-packages/django/apps/config.py", line 94, in create
remote: module = import_module(entry)
remote: File "/app/.heroku/python/lib/python2.7/importlib/__init__.py", line 37, in import_module
remote: __import__(name)
remote: ImportError: No module named djangocms_history
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 udsa-content-repository.
remote:
To https://git.heroku.com/udsa-content-repository.git
! [remote rejected] fixing-heroku-build -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/udsa-content-repository.git'在激活ImportError: No module named djangocms_history之前,当我试图在本地运行命令时,我得到了相同的错误virtualenv,所以我不知道这是否与此有关。有人知道怎么解决这个问题吗?
发布于 2019-04-03 19:23:59
您的requirements.txt文件似乎丢失了:
djangocms-history==1.0.0发布于 2019-04-03 19:14:44
pip install djangocms-historydjangocms_history添加到INSTALLED_APPS中python manage.py migrate djangocms_history发布于 2019-04-03 19:20:08
你有一个ImportError。
转到您的代码,搜索您的整个代码库中的djangocms_history
然后要么pip install djangocms_history,重新启动你的wsgi,然后尝试它。
或者把它注释掉,还有任何使用它的东西。那就再试一次。
取决于它是什么,您也可能不得不进行迁移和迁移。
https://stackoverflow.com/questions/55502538
复制相似问题