[英]Pushing Django app to heroku throws error “ImportError: No module named djangocms_history”
I have a Django project that I am trying to push to heroku. 我有一个Django项目,尝试将其推送到heroku。 My requirements.txt file is
我的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
When I try to deploy to heroku I get the following error: 当我尝试部署到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'
I was getting that same error ImportError: No module named djangocms_history
when trying to run commands on my local before I activated virtualenv
so I don't know if that has anything to do with it. 我在激活
virtualenv
之前尝试在本地运行命令时遇到了同样的错误ImportError: No module named djangocms_history
因此我不知道这是否与它有关。 Anyone know how to fix this? 有人知道怎么修这个东西吗?
pip install djangocms-history
pip install djangocms-history
djangocms_history
to your INSTALLED_APPS
djangocms_history
添加到您的INSTALLED_APPS
python manage.py migrate djangocms_history
python manage.py migrate djangocms_history
You have an ImportError
. 您有一个
ImportError
。
ImportError
for python2. python2的
ImportError
。
Go to your code, search your entire code base for djangocms_history
转到您的代码,在整个代码库中搜索
djangocms_history
Then either pip install djangocms_history
, restart your wsgi, and try it out. 然后
pip install djangocms_history
,重新启动您的wsgi,然后尝试一下。
Or comment it out, and anything that uses it. 或将其注释掉,以及所有使用它的注释。 Then try running again.
然后尝试再次运行。
Depending on what it is, you might also have to make migrations and migrate too. 根据具体情况,您可能还必须进行迁移和迁移。
您的requirements.txt
文件似乎丢失了:
djangocms-history==1.0.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.