htmx examples from https://htmx.org/examples/ implemented with a python/flask server
Go to file
cst 644c4cc630 initial commit 2022-06-03 18:35:25 +03:00
static initial commit 2022-06-03 18:35:25 +03:00
templates initial commit 2022-06-03 18:35:25 +03:00
.gitignore initial commit 2022-06-03 18:35:25 +03:00
LICENSE initial commit 2022-06-03 18:35:25 +03:00
Pipfile initial commit 2022-06-03 18:35:25 +03:00
Pipfile.lock initial commit 2022-06-03 18:35:25 +03:00
README.md initial commit 2022-06-03 18:35:25 +03:00
contacts.json initial commit 2022-06-03 18:35:25 +03:00
contacts_other_content.json initial commit 2022-06-03 18:35:25 +03:00
helpers.py initial commit 2022-06-03 18:35:25 +03:00
routes.py initial commit 2022-06-03 18:35:25 +03:00
run initial commit 2022-06-03 18:35:25 +03:00

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!