making my own way to learn from Corey Shafer youtube videos and put my knowledge into it.
sudo pacman -S python-pip
python -m venv venv
touch .gitignore
. venv/bin/activate
export FLASK_APP=origami.py
then use flask run
export FLASK_DEBUG=1
if '__name__' == '__main__':
app.run(debug=True)
run this command terminal
python origami.py
origami variable - is list of dictionaries
how to put the jinja2 code into html
on the base.html
{% block content %} {% endblock content %}
on other <html> files that you want to show your code,
{% extends "layout.html"%}
{% block content %}
<!-- your code goes here -->
{% endblock content %}
coming to css files
there is to ways that you can add the css file. first of all you need to create a folder called
static and then you can access it from there.
so what i have done is i have make it like `static\css'
inside that you can find the style.css.
then on templates goto the layout.html
add these codes
first one
<link rel="stylesheet" href="static/css/style.css" />
below code is python way of adding css
<link rel="stylesheet" type="text/css" href="{{url_for('static',filename='css/style.css')}}">