Django Vite Boilerplate
Integrate your vite project with django.
Integerate with
- React
- React-ts
- Vue
- Vue-ts
- Svelte
- Svelte-ts
Getting Started
Prerequisites for django
- Setup django environment
python3 -m venv env source env/bin/activate pip3 install -r requirements.txt
Example: Run react in dev mode with django
-
Start django
cp ./backend/.env.example ./backend/.env python3 ./backend/manage.py runserver
-
Install react & copy react base temaple to django templates path.
cp ./frontend/react/base.html ./backend/templates/base.html npm install --prefix ./frontend/react
-
Run in dev mode
npm run dev --prefix ./frontend/react
Example: Run in prodcution mode
- Change DEBUG mode to False in backend/.env
-
Build react project
npm run build --prefix ./frontend/react
-
Build
python3 ./backend/manage.py collectstatic # Restart django python3 ./backend/manage.py runserver