django-svelte-start Svelte Themes

Django Svelte Start

Start a project using Django + Svelte

django-svelte-start

Modern starter template for Django + Svelte projects. It includes:

  • ESBuild for building Svelte frontend.
  • Live reload for backend and frontend.
  • Prettier and ESLint for code formatting and linting.
  • Prek for automatic code checks.
  • Hatch for backend build system.

Development environment setup

Create a virtual environment and activate it:

python3 -m virtualenv venv && . venv/bin/activate

Install Python development requirements:

python3 -m pip install . prek && prek install

Install NodeJS requirements:

npm install

Process initial migrations:

python3 manage.py migrate

Start developing

Open two terminals and run these commands (one in each terminal):

npm run watch
python3 manage.py runserver

Then go to http://127.0.0.1:8000 on your browser.

Linting and formatting

prek run -a

Top categories

Loading Svelte Themes