Full-stack Django with HTMX and Tailwind

  • Updated December 5th, 2023
  • v1.0.0
Špela Giacomelli (aka GirlLovesToCode) Špela Giacomelli (aka GirlLovesToCode)

Modernize your Django application with the agility of HTMX and the elegance of Tailwind CSS!


Django is a powerful framework for creating web applications, but it requires full page reloads for user interactions. Simple, lightweight HTMX changes that; it allows you to change only a part of the page without fully reloading it.

Using Tailwind CSS along with HTMX allows you to create beautiful, agile webpages without leaving the HTML file or writing any JavaScript!

What will you learn?

Select a Part

In the first part, you'll learn about each of the tools that we'll be using in this course -- HTMX, Tailwind CSS, and Alpine.js. You'll also set up a Django project that leverages each of them.

Learning Objectives

  1. Describe what HTMX, Tailwind, and Alpine.js are and why you may want to use them with Django
  2. Configure HTMX, Tailwind, and Alpine.js to work with Django

In Part 2, each chapter will focus on a specific HTMX feature:

  • Click-to-edit pattern
  • Inline form validation
  • Editing, removing, and adding a row in a table
  • Active search and filtering
  • Updating content outside the target
  • Infinite scroll

Learning Objectives

  1. Effectively organize a Django project when using HTMX
  2. Describe how HTMX attributes can be used to interact with the Django backend
  3. Add click-to-edit, element swapping, and active search to a Django application
  4. Explain and integrate various HTMX UX patterns
  5. Add infinite scroll to a Django application
  6. Use Alpine.js in a Django application

In Part 3, you'll complete the app you've been working by adding social authentication with Django Allauth You'll also test the front-end side of the app with Cypress and deploy your app to Heroku with Docker.

Learning Objectives

  1. Set up social auth with Django and Django Allauth
  2. Write end-to-end tests with Cypress to confirm your code is working as expected
  3. Containerize Django and Postgres inside a Docker container
  4. Deploy Django, Gunicorn, and Postgres to Heroku with Docker

What do you need to know?

This course is targeted at advanced-beginners -- someone with at least 6 months of web development experience. Before beginning, you should have some familiarity with the following topics:

Meet the Author

Špela Giacomelli (aka GirlLovesToCode)

Špela Giacomelli (aka GirlLovesToCode)

GirlThatLovesToCode is passionate about learning new things -- both for herself and for teaching others. She's a fan of Python and Django and wants to know everything there is about those two. When she’s not writing code or a blog, she’s probably trying something new, reading, or spending time outside with her family.

What developers are saying

The TestDriven.io courses are some of the best courses I've ever done for any language, any platform, any price range... just some of the most thorough and well-sourced courses around.

Just a word of thanks for doing such a great job with these training courses. The thorough, entire-lifecycle approach -- from implementation through test, coverage, quality, CI/CD, and all the rest -- is what separates these courses from other training material that I've completed. I'll be able to walk away from here with knowledge and skills that I can apply immediately at work -- and for that I'm grateful. It's a rare gift in an environment where so much 'training' is really just lightweight treatment that doesn't begin to scratch the surface of real, end-to-end software development. Really well done!

The TestDriven.io courses are worth 10 times what I paid for them.

I'm writing to thank you for all the tutorials and the work you've put out there. I'm new to DevOps and I found TestDriven.io while looking for Django and DevOps related topics. One of the best collections of tutorials and guides I've seen -- very well-written, clear, and concise. You have saved me so much time and energy. Thanks from the bottom of my heart.

I am very much into buying and purchasing any course by you and your team. I've never felt like a better programmer ready to show my coding chops to the world.

Frequently Asked Questions

What tools and technologies are used in this course?

This course covers a variety of technologies and services:

Core

  1. Python
  2. Django
  3. HTMX
  4. Tailwind CSS
  5. Alpine.js

Tools

  1. pytest
  2. Cypress
  3. Django AllAuth
  4. Docker
  5. Postgres
  6. WhiteNoise
  7. Gunicorn

Services

  1. GitHub
  2. Heroku

What can I learn to build with Django, HTMX, Alpine.js, and Tailwind?

The combination of Django, HTMX, and Alpine.js forms an efficient tech stack for web apps that seek SPA-like functionality without the overhead of a full-scale front-end framework. This combination empowers a solo developer (or small teams) to deliver results comparable to those of larger teams.

What support does TestDriven.io offer?

Since the courses mimic real-world development, support is provided via Stack Overflow. Helpful users, including the developers of the courses, read and respond to messages on Stack Overflow. If you get stuck and you can't find an answer via Stack Overflow, feel free to reach out via email directly. Just be sure to detail what you've tried. For more, review Support and Consulting.

How long does it take to complete the course?

It's dependent on your current skill level. On average, it takes approximately 12 hours to complete.