All Projects → jacklinke → htmx-talk-2021

jacklinke / htmx-talk-2021

Licence: other
Code examples and slides from my 2021 talk Server-Side is Dead! Long Live Server-Side (+ HTMX), presented at DjangoCon and Code Code Code

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to htmx-talk-2021

Restclient
🦄 Simple HTTP and REST client for Unity based on Promises, also supports Callbacks! 🎮
Stars: ✭ 675 (+3650%)
Mutual labels:  ajax, requests
Saber
⚔️ Saber, PHP异步协程HTTP客户端 | PHP Coroutine HTTP client - Swoole Humanization Library
Stars: ✭ 866 (+4711.11%)
Mutual labels:  ajax, requests
Xhr.js
🌎 xhr.js is a library(< 2Kb) to make AJAX/HTTP requests with XMLHttpRequest.
Stars: ✭ 12 (-33.33%)
Mutual labels:  ajax, requests
Geolocator-2
Learn how to find and work with locations in Django, the Yelp API, and Google Maps api.
Stars: ✭ 24 (+33.33%)
Mutual labels:  requests
advanced-web-developer-bootcamp-notes-examples-and-exercises
Examples and Exercises compiled. From the awesome Advanced Web Developer Bootcamp
Stars: ✭ 24 (+33.33%)
Mutual labels:  ajax
sozlukus.com
sozlukus.com source code
Stars: ✭ 11 (-38.89%)
Mutual labels:  ajax
proxy ip pool
python编写的爬虫代理ip池
Stars: ✭ 18 (+0%)
Mutual labels:  requests
python3-concurrency
Python3爬虫系列的理论验证,首先研究I/O模型,分别用Python实现了blocking I/O、nonblocking I/O、I/O multiplexing各模型下的TCP服务端和客户端。然后,研究同步I/O操作(依序下载、多进程并发、多线程并发)和异步I/O(asyncio)之间的效率差别
Stars: ✭ 49 (+172.22%)
Mutual labels:  requests
customer-ajax-login
Free magento 2 extension for Popup and AJAX based Login and Sign Up | Manish Joy
Stars: ✭ 14 (-22.22%)
Mutual labels:  ajax
requestsR
R interface to Python requests module
Stars: ✭ 12 (-33.33%)
Mutual labels:  requests
premeStock
Monitors for restocks
Stars: ✭ 53 (+194.44%)
Mutual labels:  requests
weibo topic
微博话题关键词,个人微博采集, 微博博文一键删除 selenium获取cookie,requests处理
Stars: ✭ 28 (+55.56%)
Mutual labels:  requests
Online-Appointment-Booking-System
An Online Appointment Booking System for Retail Chain Clinics with both the User as well as the Admin Side.
Stars: ✭ 95 (+427.78%)
Mutual labels:  ajax
crawler
requests+lxml爬虫,简单爬虫架构
Stars: ✭ 72 (+300%)
Mutual labels:  requests
spring-mvc-ex
SpringMVC 게시판 구현 : 연습예제
Stars: ✭ 17 (-5.56%)
Mutual labels:  ajax
fasthtmx
FastAPI-HTMX Demo Project
Stars: ✭ 62 (+244.44%)
Mutual labels:  htmx
wc18-cli
An easy command line interface for the 2018 World Cup
Stars: ✭ 15 (-16.67%)
Mutual labels:  requests
angular-http-cache
Speed up your remote requests by automatically caching them on client and add support for offline navigation.
Stars: ✭ 25 (+38.89%)
Mutual labels:  requests
requests
http requests lib for golang
Stars: ✭ 67 (+272.22%)
Mutual labels:  requests
cute-http
一个基于axios封装的更易用的http库。
Stars: ✭ 18 (+0%)
Mutual labels:  ajax

Server-Side is Dead! Long Live Server-Side (+ HTMX)

This repository contains the example code and slides for the talk "Server-Side is Dead! Long Live Server-Side (+ HTMX)", given at DjangoCon US 2021 and then (modified) for Code Code Code in December of 2021.

Contents

Examples

Here are screenshots of the examples I talk through, transitioning from plain Django templates (plus a bit of ajax in the settings example), to Django + HTMX. The examples folder contains a django project with each of these examples.

Keep in mind these examples are stripped to the absolute minimum in order to make the concepts I discuss in the talk as clear as possible, so the examples do not take security best practices into account. For instance, in the settings example, you would want to decorate the view with @login_required.

The example includes fixtures for getting up-and-running quickly. After migrating, loading fixtures, and starting runserver, log into admin (http://127.0.0.1:8000/admin/) with credentials user pass, and then go to the homepage (http://127.0.0.1:8000/).

Messaging

How do you add the ability to click on an icon to archive messages, without having to refresh the entire page to see the changes? Here's an example.

Messages screenshot

Settings

In this example, we allow the current user to change their settings via a set of checkboxes (which relate to BooleanField fields in the database) without refreshing the page. They also get a momentary alert of the update.

One-click settings screenshot

Tabs-With-Forms

This example presents a use-case where multiple forms are needed on a single webpage, each hidden within its own tab. We use HTMX to load each tab's contents only when needed and to submit each form without needing a page refresh.

Tabbed forms screenshot

Maps with Lazy Data Popovers

This example presents a use-case where a data-rich map (or datatable, etc) utilized popovers with additional information. Rather than loading all of the popover content on page load, we can load the popover contents lazily when the user clicks on the map feature.

Lazy Data Popovers screenshot

Demonstration Project

A demonstration project is provided with each pattern discussed in the talk.

  1. Install the requirements pip install -r requirements.txt
  2. Migrate python manage.py migrate
  3. Install fixtures python manage.py loaddata fixtures.json
  4. Run server python manage.py runserver
  5. Log into admin http://127.0.0.1:8000/admin/ with credentials: user & pass
  6. Go to the home page http://127.0.0.1:8000/ and use the navigation options to try out the various demonstrations. Hint: open your browser's development tools pane.

Slides

Slides are available in the media folder. You can access them directly here:

Video

Video on DjangoConUS 2021 YouTube Playlist Video on Code Code Code YouTube Playlist

Resources

Resources mentioned in the talk:

  • htmx.org - The home for HTMX examples, references, and further resources.
  • django-htmx - Adam Johnson's django package with helpful utilities for making integration of Django and HTMX easier.
  • awesome-htmx - Links to talks, blog posts, examples, and other things related to HTMX.
  • HTMX Discord - Very active community board for discussing HTMX and Django + HTMX.
  • r/htmx on Reddit
  • HTMX on GitHub
  • _hyperscript - A speculative javascript library designed to work alongside HTMX. Simplifies writing event handlers and developing highly responsive user interfaces.
  • Alpine.js - A lightweight javascript library for composing behavior directly in your markup which plays nicely with HTMX.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].