ImportError: No module named django.core.wsgi in Elastic Beanstalk

Question:

I was getting started with AWS’ Elastic Beanstalk.

I am following this tutorial to deploy a Django/PostgreSQL app.

I did everything before the ‘Configuring a Database’ section. The deployment was also successful but I am getting an Internal Server Error.

Here’s the traceback from the logs:

Any idea what’s wrong?

Answer:

Have you created a requirements.txt in the root of your application? Elastic Beanstalk will automatically install the packages from this file upon deployment. (Note it might need to be checked into source control to be deployed.)

pip freeze > requirements.txt

(You will probably want to do that from within a virtualenv so that you only pick up the packages your app actually needs to run. Doing that with your system Python will pick up every package you’ve ever installed system-wide.)

Leave a Reply