Prerequisite : Flask installation
Flask is a lightweight framework written in Python. It is lightweight because it does not require particular tools or libraries and allow rapid web development. today we will create a weather app using flask as a web framework. this weather web app will provide current weather updates of cities searched.
Basic setup :
Create a file and name it as weather.py
Linux command to create a file
Now, create a folder templates with a file name
Linux command to create a folder and a file
mkdir templates && cd templates && touch index.html
The project folder will look like :
Editing files :
Use your own API key from Weather API and place it in API variable. Now edit
Navigate to templates/index.html and edit it: link to the index file.
Now you can run the server to see the weather app –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Flask project - Create a Joke App with PyJokes
- Weather app using Django | Python
- Todo list app using Flask | Python
- Deploy Python Flask App on Heroku
- Dockerize your Flask App
- Create a GUI for Weather Forecast using openweathermap API in Python
- Python | Real time weather detection using Tkinter
- Scrapping Weather prediction Data using Python and BS4
- Get Live Weather Desktop Notifications Using Python
- Implementing Weather Forecast using Facade Design Pattern in Python
- Find current weather of any city using OpenWeathermap API in Python
- Python | Using for loop in Flask
- Python | Introduction to Web development using Flask
- Python | Build a REST API using Flask
- Profile Application using Python Flask and MySQL
- Deploying Your Web App using Azure App Service
- How to get daily weather notification on mobile using Node.js and Twilio API ?
- Setup API for GeeksforGeeks user data using WebScraping and Flask
- Deploy Machine Learning Model using Flask
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.