Posts not showing up on home page in Flask

Posts not showing up on home page in Flask

<strong>The Goal</strong>

The Goal

I'm creating a Flask website to serve as the UI for a custom bioinformatics pipeline. The way I'm trying to design it is such that the user fills in the pipeline parameters (e.g. Project Name, Data Type, Number of Samples, etc.) in a multi-page form (kind of like the checkout process in online ordering) and then I would like these parameters to be saved to the user's account page as separate "posts".

The Issue

I've been following a Flask Tutorial online (https://www.youtube.com/watch?v=QnDWIZuWYW0&list=PL-osiE80TeTs4UjLw5MM6OjgkjFeUxCYH&index=2) about how to save the "posts" (pipeline parameters) to the user's dashboard by supplying fake or sample "posts" to the dashboard's html template, but nothing shows up at all. What am I doing wrong?

The Source Code

routes.py:

posts = [
            {
                'username': 'claudiadast',
                'date_posted': 'September 22, 2018',
                'stack_name': 'wgs-test-stack',
                'start_point': 'fastq',
                'input_uri': 's3://pipeline-validation/smallfq/',
                'build': 'GRCh38',
                'ome': 'wgs',
                'project_id': 'summerwater598'
            },
            {
                'username': 'claudiadast',
                'date_posted': 'September 10, 2018',
                'stack_name': 'clinical-exome',
                'start_point': 'fastq',
                'input_uri': 's3://pipeline-validation/Clinex/',
                'build': 'GRCh38',
                'ome': 'wes',
                'project_id': 'summerwater598'
            }
        ]


@app.route('/') @app.route('/home') def home(): return render_template('home.html', posts=posts)

home.html:

{% extends "layout.html" %}
{% block content %}
    {% for post in posts %}
        <h1>{{ post.stack_name }}</h1>
        <p>{{ post.username }} on {{ post.date_posted }}</p>
        <p>Pipeline Parameters:</p>
        <p>{{ post.stack_name }}</p>
        <p>{{ post.start_point }}</p>
        <p>{{ post.input_uri }}</p>
        <p>{{ post.build }}</p>
        <p>{{ post.ome }}</p>
        <p>{{ post.project_id }}</p>
    {% endfor %}
{% endblock content %}

layout.html:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>Psychcore Pipeline</title>
        <link rel="stylesheet" href="static/site.css"
    </head>
    <body>
        {% include 'includes/_navbar.html' %}
        <div class="container">
        {% block body %}{% endblock %}
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ category }}">
                        {{ message }}
                    </div> 
                {% endfor %}
            {% endif %}
        {% endwith %}
        </div>

    &lt;script src='https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js'&gt;&lt;/script&gt;
&lt;/body&gt;

</html>


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Understanding of Meter Tag in HTML 5

This post explains the HTML 5 meter tag and how to create it

How to Sending form data to a template on flask

I'm trying to create a login page and have managed to get each separate page working but when you click "Login" it should take you to a profile page and when you click "Register" it should take you back to login. This does not happen and instead comes up with the 'can't reach this page'. How can I use flask to send the data from the template and render a new page?

The Ultimate Guide to Web Development with HTML and CSS

The Ultimate Guide to Web Development with HTML and CSS. Learn Web Development by creating a Blog with HTML and CSS. Make a web applications using HTML5 and CSS3. Create a blog from Scratch.