Vaibhav Paliwal
Vaibhav Paliwal

Reputation: 1

No module named ‘application’` when deploying to AWS elastic beanstalk

I am trying to deploy a django project on elastic beanstalk, I have used this AWS official Doc for django deployment on EB: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html

These are Steps i followed:

  1. eb init
  2. eb create
  3. put CNAME in ALLOWED_HOST
  4. eb deploy

and when i try to see my website, i get ERROR: "502 Bad Gateway: nginx" So i checked web.stdout.log file and found this error: https://i.sstatic.net/MrWBO.png

This is my django.config file (present in .ebextensions folder) https://i.sstatic.net/XPXnS.png

This is my directory structure: https://i.sstatic.net/iZzcG.png

This is my wsgi.py file: https://i.sstatic.net/jl6gs.png

I want to solve this error. I don't know what's the problem, and I really need someone to help me solve this error, Your help means a lot to me. if you need any additional information let me know.

Upvotes: 0

Views: 116

Answers (1)

pcoder
pcoder

Reputation: 33

I am not sure if you were able to solve this. But have you tried updating the wsgi path in .ebextensions For Python Flask I had to make it as -

option_settings:
    "aws:elasticbeanstalk:container:python":
        WSGIPath: application:application

Also, you can check the configuration in AWS EB console, the wsgi path mentioned there should also be the correct one.

Upvotes: 0

Related Questions