This repository contains a Django application that demonstrates live search functionality using HTMX for handling AJAX requests and Tailwind CSS for responsive styling. These technologies are ideal for simplifying modern web development by streamlining rapid prototyping and enhancing user experience through dynamic content updates.
This project showcases how to implement a live search feature in a Django application using HTMX and Tailwind CSS. The application allows users to search and view results dynamically without reloading the page.
- Real-time search results
- Responsive design with Tailwind CSS
- Django backend with HTMX for AJAX requests
- Optimized and compressed CSS/JS using Django Compressor
- Django: The web framework used for the backend.
- HTMX: A library for handling AJAX requests and updating the DOM.
- Tailwind CSS: A utility-first CSS framework for styling.
- Django Compressor: A tool for compressing and combining CSS and JavaScript files.
- Python 3.10+
- Django 4.2+
-
Clone the repository:
Using HTTPS:
git clone https://github.com/yourusername/django-htmx-tailwind-live-search.git cd django-htmx-tailwind-live-search
Using SSH:
git clone git@github.com:yourusername/django-htmx-tailwind-live-search.git cd django-htmx-tailwind-live-search
-
Create a virtual environment and activate it:
python -m venv .venv source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
Run database migrations:
python manage.py migrate
-
Start the development server:
python manage.py runserver
- Open your web browser and navigate to
http://127.0.0.1:8000/
. - Use the search bar to perform live searches.
This project is licensed under the MIT License. See the LICENSE file for details.