htmx examples from https://htmx.org/examples/ implemented with a python/flask server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
cst 644c4cc630 initial commit 3 weeks ago
static initial commit 3 weeks ago
templates initial commit 3 weeks ago
.gitignore initial commit 3 weeks ago
LICENSE initial commit 3 weeks ago
Pipfile initial commit 3 weeks ago
Pipfile.lock initial commit 3 weeks ago
README.md initial commit 3 weeks ago
contacts.json initial commit 3 weeks ago
contacts_other_content.json initial commit 3 weeks ago
helpers.py initial commit 3 weeks ago
routes.py initial commit 3 weeks ago
run initial commit 3 weeks ago

README.md

Enjoy the HTMX examples rendered with Flask!

Install

git clone
cd /htmx-examples-with-flask
pipenv install

Run

./run

Use

What is where

@app.route("/examples/click-to-edit/")
def get_click_to_edit():
  • It is followed by additional routes, as the example requires, e.g.
@app.route(
  "/contact/<int:id>",
  methods=['GET'])
def get_contact(id):

@app.route(
  "/contact/<int:id>",
  methods=['PUT'])
def put_contact(id):

Other notes

Sample data is in contacts.json. There are simple routines to read and write to it. Not safe, not production ready, etc. If you think that using something production-like, e.g. a DB would make more sense for the examples please let me know. My thinking so far is that it will only clutter the examples codebase.

Not super-easy?

If the examples' implementation is not super-easy to install and figure out, please write me to tell me what makes it difficult.

Thanks!