Giter VIP home page Giter VIP logo

booknook's Introduction

Flask Application Deployment on AWS Elastic Beanstalk

This guide outlines the steps to deploy a Flask web application with a MongoDB backend on AWS Elastic Beanstalk.

Linux/MacOS

Prerequisites

  1. AWS Account:

    • Ensure you have an AWS account. If not, sign up for an account at AWS.
  2. AWS CLI and Elastic Beanstalk CLI:

    • Install the AWS CLI by following the instructions here.
    • Install the Elastic Beanstalk CLI by running pip install awsebcli.
  3. MongoDB:

    • Set up a MongoDB database and obtain the MongoDB URI.
  4. Git:

  5. Python and Pip:

    • Ensure you have Python and Pip installed on your machine.

Running App Locally

  1. source venv/bin/activate
  2. pip install -r requirements.txt
  3. flask run
  4. Open localhost:5000

Uninstall All Dependencies

  1. source venv/bin/activate
  2. pip freeze | xargs pip uninstall -y
  3. deactivate

Troubleshoot ModuleNotFoundError

In the case of all dependencies are correctly installed but the app gets ModuleNotFoundError, do the following:

  1. Close all IDE and terminal
  2. Open IDE and terminal again

Windows

Prerequisites

  1. Install the most recent stable python version https://www.python.org/downloads/windows/
  2. python -m pip install --upgrade pip
  3. virtualenv venv
  4. set-executionpolicy remotesigned
  5. .\venv\Scripts\activate
  6. pip install -r requirements.txt

Troubleshoot ebcli

Uninstall ebcli from a specified python version

py -3.12 -m pip uninstall awsebcli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.