Precious Chika
Precious Chika

Reputation: 329

Django; 44 connect() failed (111: Connection refused) while connecting to upstream on AWS Elastic Bean

I want to upload my django project to AWS ElasticBean but I have been getting 502 Bad Gateway error; nginx/1.20.0. I have gone through few videos on youtube but it doesn't seems to work.

Here is my project directory

├───.ebextensions
├───.elasticbeanstalk
├───ebdjango
├───.gitattributes
├───.gitignore
├───db.sqlite3
├───manage.py
├───Pipfile
├───Pipfile.lock
└───requirements.txt

Here is my django.config setting

The tutorials i have been seeing does not explain most of their settings in details and I don't want to just copy and paste code without knowing it's application.

option_settings:
  aws:elasticbeanstalk:application:environment:
    DJANGO_SETTINGS_MODULE: "awsdjango.settings"
    PYTHONPATH: "/var/app/current:$PYTHONPATH"
  aws:elasticbeanstalk:container:python:
    WSGIPath: ebdjango.wsgi:application

I dont't have a Procfile, Gunicorn package nor their config in my project.

Please let me know in details where i'm not getting it right whether in my settings file or anywhere, just point it out for me.

Upvotes: 1

Views: 601

Answers (1)

dmcm
dmcm

Reputation: 11

I fixed this error by changing

ebdjango.wsgi:application

to

api.wsgi:application

Which is the name of my django app. Hope this helps!

Upvotes: 1

Related Questions