Heroku Internal server Error logs ImportError: No module named captcha

我与影子孤独终老i 提交于 2019-12-10 11:43:26

问题


Heroku Internal Server Error with django-simple-captcha

I installed django simple captcha using

> pip install django-simple-captcha

and made all the necessary changes in settings.py to get captcha running on my local machine. It was working absolutely fine on my machine But when I deployed it on heroku using:

> git push heroku master
> 
> heroku pg:reset
> 
> PGUSER=my_username PGPASSWORD=my_password heroku pg:push local_db HEROKU_DB_NAME --app my_appname

I got Internal Server Error on looking at the logs using:

heroku logs show :
2013-12-30T18:40:53.136610+00:00 app[web.1]:     __import__(name)
2013-12-30T18:40:53.136610+00:00 app[web.1]: **ImportError: No module named captcha**
2013-12-30T18:40:53.136610+00:00 app[web.1]:     app = import_module(appname)

回答1:


You have to specify django-simple-captcha module requirement in requirements.txt file, which should be in your projects root directory.

You can generate requirements.txt file using pip freeze command as stated in Heroku documentation:

$ pip freeze > requirements.txt


来源:https://stackoverflow.com/questions/20845635/heroku-internal-server-error-logs-importerror-no-module-named-captcha

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