Background
In recent years, HTMX + Alpine.js is becoming more and more popular in the Django community since it provides a new and simpler way to build a modern web application while keeping things simple.
However, many developers do not know they have other options.
As a full stack developer who prefer Hotwire
, I published The Definitive Guide to Hotwire and Django to help people to learn this great tech, and also received many thanks in the past years.
But I know there are still many people who want to learn Hotwire
but cannot afford the book.
So I decide to put some basic chapters of the book online for free, the source markdown files and images are all hosted on GitHub.
About this book
This open source book (Hotwire Django Tutorial) is to help Django developers to learn Hotwire
Hotwire is an alternative approach to building modern web applications without using much JavaScript by sending HTML instead of JSON over the wire.
Below are some popular websites built by Hotwire:
- Github (https://github.com/), Github is built using Turbo and Catalyst (A tech inspired by Stimulus)
- Hey (https://hey.com/), Hey is an email service and productivity platform that aims to revolutionize the way people manage their email
- Basecamp (https://basecamp.com/), Basecamp is a project management and collaboration tool designed to help teams stay organized and work together effectively
- Forem (https://github.com/forem/forem): Forem is an open-source platform for building online communities, dev.to is built using Forem.
Hotwire has become the default frontend solution in Rails
, and it is also very popular in the PHP
community (Laravel
, Symfony
).
For now, there is no good content about Hotwire in the Django community, so I decided to publish this book to help the developers.
Objectives
By the end of this book, you will be able to:
- Learn Hotwire includes
Turbo
andStimulus
, and what problem they can help solve. - Jump start frontend project bundled by Webpack.
- Setup Turbo and Stimulus.
- Learn how page navigation works in
Turbo Drive
- Understand what is cache in Turbo Drive and how preview works.
- Learn what is
Stimulus
and howStimulus Controller
work. - What are Stimulus
Values
,Targes
, andActions
- Use Stimulus to build a Datetime picker and improve the form submission process.
- Learn about 15 UI examples (
inline editing
,Type as Search
,Form Validation
, etc.), which can help you solve the UI interaction problem in many cases.
With Hotwire, we can bring SPA-like experience
to our Django web app:
- We do NOT need heavy frontend solution such as React, Vue, which requires giving over control of the DOM to their framework
- We do NOT need JSON and Django REST framework
- We will stick with Django form, Django templates.
What it contains
- About 20 chapters and relevant screenshots
- A online demo which can let you test the feature.
Open Source
This book is open source on GitHub and free to read online.
If you have any feedback or suggestions, please feel free to open an issue on GitHub.
https://github.com/hotwire-django/hotwire-django-tutorial