ImportError: no module named django.core.wsgi in the elastic beanstalk

I started with AWS Elastic Beanstalk .

I follow this guide to deploy a Django / PostgreSQL application .

I did everything until the "Database Setup" section. The deployment was also successful, but I received an internal server error.

Here is the trace from the logs:

 mod_wsgi (pid=30226): Target WSGI script '/opt/python/current/app/polly/wsgi.py' cannot be loaded as Python module.
[Tue Sep 15 12:06:43.472954 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] mod_wsgi (pid=30226): Exception occurred processing WSGI script '/opt/python/current/app/polly/wsgi.py'.
[Tue Sep 15 12:06:43.474702 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] Traceback (most recent call last):
[Tue Sep 15 12:06:43.474727 2015] [:error] [pid 30226] [remote 172.31.14.126:53947]   File "/opt/python/current/app/polly/wsgi.py", line 12, in <module>
[Tue Sep 15 12:06:43.474777 2015] [:error] [pid 30226] [remote 172.31.14.126:53947]     from django.core.wsgi import get_wsgi_application
[Tue Sep 15 12:06:43.474799 2015] [:error] [pid 30226] [remote 172.31.14.126:53947] ImportError: No module named django.core.wsgi

Any ideas what is wrong?

+5
source share
3 answers

requirements.txt ? Beanstalk . ( , , , , .)

pip freeze > requirements.txt

(, virtualenv, , . Python , - . )

+2

(fooobar.com/questions/1607467/...) carl-g . , , , requirements.txt . , django mysite. , eb → , requirements.txt .

+1

.ebextensions, .

( Elastic Beanstalk) 3 4 Elastic Beanstalk.

Django 1.11 Python 2.7

0
source

Source: https://habr.com/ru/post/1607467/


All Articles