Member-only story
Build a Python Flask App To See the Places You’ve Travelled
Pin your trip memories on a “HERE” map using Python
I hope you’ve had a great summer holiday. Wouldn’t you and your friends be happy to recall the places you visited together?
In this article, I’m going to show you how to create a custom map where you can pin vacation photos of all the places you have been to. You’ll have an option to add text to better describe your trip memories.
I’ve already written a tutorial about how to plan your holiday with HERE maps. This tutorial is independent, so you can start here, and check the other one later if you’re interested. We’re going to reuse some of the technologies and apply more enhancements. In the end, you’ll learn how to deploy your app to Heroku, so your friends can also see it.
Let’s begin!
Create The Project
Requirements
What you’ll need:
- Some awesome photos from your holiday.
- The coordinates of the places you visited. We’ll use the geopy Python library for this task:
pip install geopy
- Flask — lightweight web application framework:
pip install Flask
- HERE developer account. Click here for instructions on how to create an API key. We’ll need this to make the call to the HERE maps from our app.
- Heroku account — this tool is used to build, and run applications on the cloud. Currently, you can host one app for free if you don’t want a paid account.
Coding part
- Create a new Python file, for example,
app_runner.py
, and paste the following code:
2. Create a new directory in the project’s folder called templates
. Create the map.html
file in that folder.
3. Paste the following content: