SoWeather is a simple Flask web application Application that provides weather information for a specified location. It is built using Python and Flask framework.
The SoWeather Flask Application was created following the tutorial https://dev.to/cscarpitta/creating-a-simple-weather-app-with-python-and-flask-5bpd/ written by initialy https://dev.to/cscarpitta
- Retrieve current weather data for a specified location.
- Display the temperature, humidity, and weather description.
Before running the application, ensure that the following dependencies are installed:
- Python 3.x
- Flask
- requests
- having a OpenWeather account for token/API-KEY
You can install the required packages by running the following command:
pip install -r requirements.txt
To set up and run the Weather Flask Application on your local machine, follow these steps:
- Clone the project repository to your computer
git clone https://github.com/sowousmane/Flask.git
- Change to the project directory
cd Flask
- Create a virtual environment
python3 -m venv venv
- Activate the virtual environment
- On macOS and Linux:
source env/bin/activate
- On Windows:
env\Scripts\activate
- Install the required dependencies:
pip install -r requirements.txt
- Create a .env file
OPEN_WEATHER_TOKEN=your_weather_token
- Run the application:
flask --app weather.py --debug run
- Open your web browser and navigate to http://localhost:5000 to access the Weather Flask Application.
To run the Weather Flask Application using Docker Compose, follow these steps:
-
Make sure you have Docker and Docker Compose installed on your machine. You can download and install them from the official Docker website.
-
Clone the project repository to your computer
git clone https://github.com/sowousmane/Flask.git
- Change to the project directory
cd Flask
- Create a .env file
OPEN_WEATHER_TOKEN=your_weather_token
- Build and start the Docker containers using Docker Compose:
docker-compose up -d
This command will build the Docker image and start the containers in detached mode.
-
Open your web browser and navigate to
http://localhost:5000
to access the Weather Flask Application running with Docker Compose. -
To stop and remove the containers, run the following command in the project directory:
docker-compose down
This will stop and remove the containers created by Docker Compose.
To run the Weather Flask Application in Docker, follow these steps:
-
Make sure you have Docker installed on your machine. You can download and install Docker from the official Docker website.
-
Puul and run the image in your computer:
docker run --rm -e OPEN_WEATHER_TOKEN=your_token -p 5005:5000 kbosow/flask-weather:0.1.0
The Weather Flask Application was developed following the tutorial "Creating a Simple Weather App with Python and Flask" by Carlo Scarpitta.
This project is licensed under the MIT License.