Heroku Internal server Error logs ImportError: No module named captcha

2.3k views Asked by At

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

There are 1 answers

1
niekas On BEST ANSWER

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