Open Source eBook: Hotwire Django Tutorial

Table of Contents

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:

  1. Github (https://github.com/), Github is built using Turbo and Catalyst (A tech inspired by Stimulus)
  2. Hey (https://hey.com/), Hey is an email service and productivity platform that aims to revolutionize the way people manage their email
  3. Basecamp (https://basecamp.com/), Basecamp is a project management and collaboration tool designed to help teams stay organized and work together effectively
  4. 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:

  1. Learn Hotwire includes Turbo and Stimulus, and what problem they can help solve.
  2. Jump start frontend project bundled by Webpack.
  3. Setup Turbo and Stimulus.
  4. Learn how page navigation works in Turbo Drive
  5. Understand what is cache in Turbo Drive and how preview works.
  6. Learn what is Stimulus and how Stimulus Controller work.
  7. What are Stimulus Values, Targes, and Actions
  8. Use Stimulus to build a Datetime picker and improve the form submission process.
  9. 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:

  1. We do NOT need heavy frontend solution such as React, Vue, which requires giving over control of the DOM to their framework
  2. We do NOT need JSON and Django REST framework
  3. We will stick with Django form, Django templates.

What it contains

  1. About 20 chapters and relevant screenshots
  2. 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

Book URL

https://tutorial.saashammer.com/

Launch Products Faster with Django

SaaS Hammer helps you launch products in faster way. It contains all the foundations you need so you can focus on your product.

Michael Yin

Michael is a Full Stack Developer from China who loves writing code, tutorials about Django, and modern frontend tech.

He has published some ebooks on leanpub and tech course on testdriven.io.

He is also the founder of the AccordBox which provides the web development services.

Django SaaS Template

It aims to save your time and money building your product

Learn More

Hotwire is the default frontend solution shipped in Rails, this book will teach you how to make it work with Django, you will learn building modern web applications without using much JavaScript.

Read More
© 2018 - 2024 AccordBox