• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sandbox for using Django with HTMX and Alpine.JS

django-htmx-alpine

This project is just a basic todo list.

However, it is made using a combination of Django, Alpine.JS and HTMX, and shows how you can get the reactivity of a frontend JS framework without sacrificing the benefits of your server-side framework (Session authentication, templating, etc).

A live demo can be seen here.

Setup Instructions

  • Create a virtualenv and install the required dependencies

    • Using Poetry (recommended):
      • Create a virtualenv and install the required dependencies
        • Dev/Testing environment: poetry install
        • Production environment: poetry install --no-dev
      • Activate the virtualenv
        • poetry shell
    • Using virtualenvwrapper:
      • Create a new virtualenv
        • mkvirtualenv django-htmx-alpine
      • Activate the virtualenv
        • workon django-htmx-alpine -or- source ~/[your_virtualenv_dir]/bin/activate
      • From the project's root folder (django_htmx_alpine), install the required dependencies
        • pip install -r requirements.txt
    • Running tests
      • From the project's root folder, run npm install.
      • To run unit tests, run npm run jest.
      • To run e2e tests, run npm run cypress.
  • (optional) You can generate a new secret key from the Django shell (manage.py shell) and set it as the SECRET_KEY in settings.py: from django.core.management import utils print(utils.get_random_secret_key())

  • Run manage.py migrate to generate a database.

  • Run manage.py runserver to start the development server

  • If you want the HTMX weather demo to work, update settings.WEATHER_API_KEY with an API key from OpenWeather using the 'Current Weather Data' API.

More Repositories

1

phoenix-todo-list

Yet another todo list. Made using the Phoenix web framework. Features: Basic CRUD, LiveView CRUD, REST API, OpenAPI spec, Playwright E2E tests, GitHub Actions CI, and more!
Elixir
21
star
2

phoenix-quiz-game

Make quizzes, take quizzes, manage quiz sessions, and keep track of the results. Made with Phoenix + LiveView.
Elixir
7
star
3

hetzner-dns-tools

A simple Hetzner DNS API client for Python and Bash
Python
7
star
4

django-menu-maker

Create customized menus for your restaurant using Django and Django REST Framework.
Python
6
star
5

epub2mp3

Convert an ePub to an mp3 using Microsoft's excellent Edge TTS (text-to-speech) service.
Shell
4
star
6

django-todo-api

Yet another todo list API. Made with Django and DRF.
Python
4
star
7

alpine-htmx-router-demo

A demo site made using a router powered by HTMX + Alpine.js
CSS
3
star
8

svelte-reddit

A minimalist reddit client made using Svelte.
Svelte
2
star
9

omni-qr-chrome

A small Chrome extension that always displays a QR code in the corner of your browser window. Perfect for streamers who use a web browser while streaming.
JavaScript
2
star
10

livebook-snippets

My personal Elixir/Phoenix bible. A collection of markdown files that are compatible with Livebook.
Shell
1
star
11

vue-blog--bootstrap

A basic working demo using Vue.JS and BootstrapVue
Vue
1
star
12

phoenix-multi-db-demo

A proof-of-concept implementation of a multi-database Phoenix application.
Elixir
1
star
13

wallabag

Set up Wallabag easily, with Docker/Podman and docker-compose.
Shell
1
star
14

osx-kvm-helpers

Helpers for OSX-KVM
Shell
1
star
15

elixir-api-playground

An Elixir library for me to explore the usage of JSON- and XML-powered APIs.
Elixir
1
star
16

eleventy-daisyui-starter

A starter kit for using Eleventy (aka 11ty) with DaisyUI.
Nunjucks
1
star
17

django-jsonsaver

An API and web client for CRUDing arbitrary JSON data
Python
1
star