502 bad gateway django elastic beanstalk - django

I got the django app deployed with elastic beanstalk on aws, I setup postgresql for it as well to work with one on aws. Unfortunately, following
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-django.html
I am getting 502 bad gateway after
eb open
I'm not really getting any errors, my app runs on local. I'm using the debug server, I also managed to run it on waitress. I was reading the oceans of info online and the only thing I can think of - do I need to actually deploy to a production server locally or can I just use EC2 for that? I'm learning about AWS as I go, so sorry if I'm not understanding something here :)
Thank you!

Related

Elastic Beanstalk 504 Gateway Timeout Error - Django

I recently completed the W3schools.com Django Tutorial. I followed it step by step. Everything works as expected locally. I also created and connected a PostgreSQL database on Amazon RDS to my app. Eventually I deployed the Django application to Elastic Beanstalk. Finally I visited the website and the homepage works, including 5 items added to the database during the tutorial which was migrated from the tutorial to the Amazon RDS. Unfortunately, neither the Django admin panel nor a simple subdirectory of the website are accessible. I get a 504 Gateway Time-out error. I don't know why. It is not clear from the logs what the issues might be. I am thinking it could possibly be a configuration file error or an incorrect value of settings.py on Django's side. Any help would be greatly appreciated.

How to send a flask application to AWS Elastic Beanstalk?

I am trying to deploy my website to Elastic Beanstalk in the console from AWS. The website structure is working perfect locally in my computer and has this structure:
- app.py
- Static --------- css --------- style.css
js --------- autocomplete.js
otherfiles.js
- Templates ----- index.html
the application app.py is an application in Flask sending the values of the variables to the index and the javascript files . I would like to make the webpage work in AWS, and, since the app.py has to be running all the time 24 hours, I have thought the best option is AWS Elastic Beanstalk. What I did was:
I created the environment
I uploaded my project in the console from AWS Elastic Beanstalk. According to what I read in other post from Stackoverflow, the best idea, is to upload the whole project on a zip file and then unzip it. I did it but all that I got is the message "Environment health has transitioned from Degraded to Severe. 100.0 % of the requests are failing with HTTP 5xx. ELB processes are not healthy on all instances. ELB health is failing or not available for all instances. Impaired services on all instances."
Does anybody know if I am heading in the right direction?
Thanks a lot
Check the beanstalk logs, you'll likely find information there that will help you determine what the problem is. I had a similar issue recently (although I was using the command line interface and not the console) and it turned out beanstalk was looking for "application.py" by default.

Django with postgresql deployment on aws elastic beanstalk

I’ve been trying to deploy a django application with postgresql db on aws elastic beanstalk and i ran into many issues that i surfed and solved. Now the application uploads fine however the environment is still not green and I constantly am receiving 502 bad gateway nginx. I’ve checked nginx logs which say 111 connection refused etc. I’ve tried changed the port to 8001 from 8000 but didn’t work out. Somebody please guide me on how to deploy my application successfully.
Here are some of the common errors logfiles. Try checking them out
--- Common Dbug Errors ---
$ eb logs
--Files (after eb ssh):
$ eb ssh
1.sudo nano /var/log/cfn-init.log
2.sudo nano /var/log/cfn-init-cmd.log (see command output and error from config)
And are you using AWS RDS to for PostgreSQL?
Here is a detailed explanation and some common error fixes discuss in this blog

how to deploy MEAN stack app on AWS elastic beanstalk?

I'm trying to deploy my mean stack app on AWS using elastic beanstalk but there doesn't seem to be a tutorial good enough that can help me through it.
I would also like to know if I should really deploy it on elastic beanstalk or Lightsail?
Can you share any articles, videos or anything good enough to help me. It will be helpful to a lot of people.
Angular Version : 7
Node Version: 10.14.1
elastic beanstalk will be the option for production while you can use light sail for testing dev enviroment
now if we talk about the deploying Mean stack app
Open Elastic Bean stalk console and you will get option to choose Webserver
Choose web server with apache, tomcat, nginx, configure it as per your requirement
at last you will get option for upload your application
Upload your app using zip file (if dist folder is output then direct deploy dist in elastic beanstalk)

How to setup AWS elastic beanstalk with windows server 2012

I'm new to AWS setup, and after having put quite a lot of time into researching an easy way to setup an instance on AWS for a .NET application, I finally decided to go with Elastic Beanstalk.
After creating an elastic beanstalk application (sample application), I need to upload my files and DB to that application and access it via an URL.
I haven't found a simple straight forward tutorial showing this. If someone has links to tutorial websites or have got this done, would like you know the process.
I've created a security group and added a keypair. Do i need to access it via SSH and install FTP and so on?
Help is appreciated.
-Adi.
There are some tutorial videos on .NET development and AWS Elastic Beanstalk available from the Amazon Web Services site here:
https://aws.amazon.com/visualstudio/