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>


html flask

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Know Everything About HTML With HTML Experts

HTML Assignment Help Australia @30% OFF from Sample Assignment, with Our Best HTML assignment help experts. Get HTML homework help online at affordable price. 100% Plag free assignment solution.

Commonly Used HTML Tags with Examples

HTML tags are keywords used in HTML to display web-pages with certain properties. They are further used for defining HTML elements. An HTML element consists of a starting tag.

HTML Basics to Learn HTML for Web Development

HTML is the mark-up language most websites are written in. In this article, we will delve into the most basics of HTML like tags and elements that are of utmost importance while writing any code in HTML. These tags help in the structuring and display of content on the web pages.

Types, Effects and Attributes

Learn about HTML Button & various effects on these buttons like ripple, fade-in & pressed. Learn types of HTML buttons - shaded button, animated button etc.

HTML Checkbox - How to Create Custom Check Box in HTML

Learn about HTML Checkbox - Various types of checkbox and their attributes, How to define multiple checkboxes, use CSS and javascript for checkboxes in HTML.