Skip to content

Instantly share code, notes, and snippets.

View amalshaji's full-sized avatar
:dependabot:

Amal Shaji amalshaji

:dependabot:
View GitHub Profile
@amalshaji
amalshaji / README.md
Created May 14, 2022 05:46 — forked from lucianoratamero/README.md
Using Vite with Django, the simple way

Using Vite with Django, the simple way

This gist has most of the things I've used to develop the frontend using vite inside a monolithic django app.

Here's a boilerplate that uses this approach: https://github.com/labcodes/django-react-boilerplate

A couple of things to note:

  • it runs in SPA mode by default. If you want SSR, you may want to look into django_vite;
  • static files unrelated to your app, like images or fonts, should be served by django, instead of imported directly inside your frontend app;