Skip to content

Instantly share code, notes, and snippets.

View jslvtr's full-sized avatar

Jose Salvatierra jslvtr

View GitHub Profile
@jslvtr
jslvtr / app.py
Created August 29, 2020 19:08
How to receive form data with Flask
from flask import Flask, render_template, request
app = Flask(__name__)
@app.route("/", methods=["GET", "POST"])
def home():
print(request.form)
print(request.form.get("account"))
return render_template("form.html")
@jslvtr
jslvtr / app.py
Created September 4, 2020 14:48
Complete code for our "Dynamic Web Pages" YouTube video under our Flask Tutorial for Beginners series: https://youtu.be/CHRikEvvcUc
from flask import Flask, render_template, request
app = Flask(__name__)
transactions = []
@app.route("/", methods=["GET", "POST"])
def home():
print(request.form)
return render_template("form.html")
@jslvtr
jslvtr / index.html
Created September 12, 2020 12:39
Web Developer Bootcamp with Flask and Python - Learning HTML Project [Step 3]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
/>
<title>Rolf Smith - Learning HTML</title>
<link rel="stylesheet" href="style.css" />
@jslvtr
jslvtr / index.html
Created September 12, 2020 12:40
Web Developer Bootcamp with Flask and Python - Learning HTML Project [Step 2]
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<img class="profile" src="profile.png" alt="Rolf's profile picture." />
<h1>I'm learning HTML and CSS!</h1>
<p>Hello, my name is Rolf Smith. I'm learning about web development, and I'm starting with HTML and CSS.</p>
<p>With HTML and CSS, I can make all sorts of websites. HTML and CSS are the most important languages to learn!</p>
<p>This website's code looks like this:</p>
@jslvtr
jslvtr / index.html
Created September 12, 2020 12:40
Web Developer Bootcamp with Flask and Python - Learning HTML Project [Step 1]
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>I'm learning HTML and CSS!</h1>
<p>Hello, my name is Rolf Smith. I'm learning about web development, and I'm starting with HTML and CSS.</p>
<p>With HTML and CSS, I can make all sorts of websites. HTML and CSS are the most important languages to learn!</p>
</body>
</html>
@jslvtr
jslvtr / .python-version
Created January 18, 2023 18:26
Barebones Flask-Smorest API showing filtering with query string arguments
3.11
@jslvtr
jslvtr / reply.py
Created April 3, 2023 14:02
Introduction to pytest: A Beginner's Guide (https://youtu.be/Kt6QqGoAlvI)
import datetime
class Reply:
def __init__(self, body: str, user: str, created: datetime.datetime) -> None:
self.body = body
self.user = user
self.created = created
def __repr__(self) -> str: