Just like our last blog website, we're going to save you the hassle of writing all your blog posts. Instead, you're going to get the posts from our API on npoint.


1. Create your own JSON bin with npoint.io.

Use the attached example blog data to create your own endpoint using npoint.io.

Here's a sample document: https://www.npoint.io/docs/674f5423f73deab1e9a7

Your endpoint should be formatted something like this: https://api.npoint.io/674f5423f73deab1e9a7

2. In main.py get hold of the JSON data at the above API endpoint.

3. Use the data from the API to render the home page, replacing the title, subtitle, author and dates of each blog post with the data from the API. (Add fields as necessary to your document.)

HINT 1: Instead of using a custom class, you can simply use Jinja variables to use the dot notation instead of square brackets. See: https://jinja.palletsprojects.com/en/3.0.x/templates/#variables

HINT 2: You'll need to use a for loop in the Jinja template, which we've done before. See the documentation here:

https://jinja.palletsprojects.com/en/3.0.x/templates/#for


This is what you're aiming for:

NOTE: The background image behind the header is this image that I found from Unsplash, feel free to go to the website to find your own.

https://unsplash.com/


SOLUTION