TannerBarcelos / weather-app-flask

Demo app written in Python-Flask to showcase how to build a Flask API and some basic rendering.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weather App

This is a learning project for me to learn Flask with Python. I use NodeJS / TS primarily and want to use Python more to do web backend stuff. Therefore, I am not using React / separate frontend for this project. I want to focus on the backend and the tutorial I am following is using Jinja2 templates.

See it live

This project uses advanced file structure and is not recommended for beginners. If you are a beginner, I recommend you follow the codebase here

Running the Project Locally

  1. Rename env.local to .env and provide values for each entry in the file.

    Head to OpenWeatherMap to get an API key.

  2. Create a virtual environment

    python -m venv .venv
  3. Activate the virtual environment

    source .venv/bin/activate
  4. Install the dependencies

    pip install -U pip && pip install -r ./requirements/requirements.txt
  5. Run the app

    cd app
    FLASK_ENV=development python server.py
  6. Open the app in your browser at http://localhost:<PORT_FROM_CONF>

  7. When you are done, kill the app and deactivate the virtual environment

     # Kill the app
     CTRL + C
    
     # Deactivate the virtual environment
    deactivate

Running the Project in Docker (Preferred) [WIP]

About

Demo app written in Python-Flask to showcase how to build a Flask API and some basic rendering.


Languages

Language:Python 67.6%Language:HTML 27.5%Language:CSS 5.0%