Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
Bootstrap
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
Secutio is a project in the early stages of development with the goal of simplifying the creation of dynamic content in a straightforward manner. The vision is that anyone should be able to build a web application using only HTML, stylesheets, and a JSON structure where "tasks" are specified.
The example outlined in this article mimics the "click to edit" functionality found in the htmx framework. Similar to htmx, this framework offers a method to enable inline editing of all or part of a record without the need for a page refresh.
To make the demo more interesting, we will use the Bootstrap framework and Flask as the backend.
#!/usr/bin/python # # https://flask.palletsprojects.com/en/3.0.x/installation/ # from flask import Flask, jsonify, request contacts = [ { "id": "1", "firstname": "Lorem", "lastname": "Ipsum", "email": "[email protected]", }, { "id": "2", "firstname": "Mauris", "lastname": "Quis", "email": "[email protected]", }, { "id": "3", "firstname": "Donec Purus", "lastname": "Purus", "email": "[email protected]", } ] app = Flask(__name__, static_url_path='', static_folder='public',) @app.route("/contact//save", methods=["PUT"]) def save_contact(id): data = request.json contacts[id - 1] = data return jsonify(contacts[id - 1]) @app.route("/contact/", methods=["GET"]) @app.route("/contact//edit", methods=["GET"]) def get_contact(id): return jsonify(contacts[id - 1]) @app.route('/') def root(): return app.send_static_file('index.html') if __name__ == '__main__': app.run(debug=True)
Related posts
- My SaaS makes $50K MRR and is built on vanilla Ruby on Rails and jQuery
- Why I selected Elixir and Phoenix as my main stack
- Ask HN: Where can one learn about boring web development?
- Ask HN: Web frameworks – which less popular framework are you using and why?
- Lona – A web framework for responsive web apps in full Python without JavaScript