This project demonstrates how to use Python to create web applications. It is primarily meant for educational purposes, specifically created for the WorldQuant University - Introduction to Data Science Module.
The skills and tools used are:
requests
package.flask
web framework.When a client visits the application, it:
All required Python packages can be found in the requirements.txt
file. Additionally, the provided Makefile
can be used to create a virtual environment by running make venv
. You will also need a Heroku account, and to have installed the Heroku CLI.
You may want to run the app using Flask locally before deploying it to Heroku, especially if you have made any changes to the code. To run locally:
make deploy
.If you are using Windows, you can:
create and activate the virtual environment.
py -3 -m venv venv
venv\Scripts\activate.bat
set FLASK_APP=weather_app/app.py
in the command line.
run python -m flask run
.
open the link in the command line.
Alternatively, you can deploy using Docker.
docker build -t weather_app .
docker run -d -p 5000:5000 weather_app
Make sure your app is ready to be deployed to Heroku by running Flask locally. To deploy to Heroku:
heroku login
and enter your credentials.heroku create
or heroku create app-name
where app-name is a custom app name.git push heroku master
.heroku config:set DEPLOY=heroku
.heroku open
or open the app online through your Heroku profile.Since this is a short demonstration of what you can do using Python to create web applications, consider extensions to the project. Some ideas include:
Please see the contributing guidelines found in CONTRIBUTING.md
.
Thanks to the following people who have contributed to this project:
This project is distributed under the GNU General Purpose License. Please see LICENSE
for more information.