A basic, Django + Inertia + Vue with Vite
- Inertia - powered by the official Inertia.js Django Adapter
- Django latest
- Vite latest - powered by Django Vite
- Vue 3 latest
- WhiteNoise - to serve static files
-
Download the repo. You can either:
a. Clone the repo (without the git history):
git clone https://github.com/oboynitro/django_inertia_vue_scaffold.git
-
Install required Python packages.
# Create and activate a virtual environment # linux and mac virtualenv venv source .venv/bin/activate #windows users ./venv/Scripts/activate # Install required Python packages pip install -r requirements.txt
-
Install required Node.js packages.
npm install
-
Run the Vite dev server:
npm run dev
-
Run Django's default migrations:
python manage.py migrate
-
Run the Django dev server (in a separate terminal):
python manage.py runserver
-
Set
DEBUG=False
in settings.py.# In settings.py ... DEBUG=False ...
-
Build the JS/assets for production:
npm run build
-
Run
collectstatic
:rm -rf staticfiles/ python manage.py collectstatic
-
Run the Django server:
python manage.py runserver