heroku errors ImportError: No module named crispy_forms

别说谁变了你拦得住时间么 提交于 2020-01-03 05:28:10

问题


I have a question When I ran this command heroku run python manage.py migrate

I got this error: ImportError: No module named crispy_forms

But on locally every things are doing well but my app is don't to run on Heroku please help me ?


回答1:


you can also do

heroku run pip freeze

that will give you a list of installed pip apps on heroku.. but ya also check your requirements.txt file




回答2:


I had the same issue when running heroku run python manage.py migrate command. Here is what I did and solve the issue:

  • Verify the crispy_forms in the INSTALLED_APPS under settings.py
  • Run pip install --upgrade django-crispy-forms or pip3 install --upgrade django-crispy-forms depends on the Python version you are using (pip3 is for Python version 3 and above)

If the aboves didn't work, try Daniel Roseman's suggestion:

  • Add this line django-crispy-forms==1.6.1 (version number will change so verify yourself here https://github.com/django-crispy-forms/django-crispy-forms/blob/dev/CHANGELOG.md) to requirements.txt file

This helped me and hope this will work for you as well. But don't forget to run (i) git add ., (ii) git commit -m "your comment", and (iii) git push heroku master before running heroku run python manage.py migrate command again.




回答3:


if you haven't already, run this on your heroku platform:

pip install django-crispy-forms

remember that your local dependencies will not be installed automatically on your heroku dynos.



来源:https://stackoverflow.com/questions/33421636/heroku-errors-importerror-no-module-named-crispy-forms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!