This project serves as a starting point you to use as a starting point for Django applications that use Vite as the asset server for development. You are welcome to us this project for all of your assignments beginning with Module 5.
This application is a hybrid MPA and SPA. It reuses all of the login stuff that we did at the end of module 3 - there is a separate page for signup/signin. Once a user is logged in they are redirected to the / view which then renders the SPA application created using React and Vite.
- Change the name property in the
pyproject.toml
file to something unique to your project. - In the root directory, install the Python dependencies
poetry install
- In the
client
directory, install the javascript dependenciesnpm install
- In the
_server
directory, create a new file called.env
- Copy the contents of
_server/.env.example
into the newly created.env
file. - Activate the poetry env
poetry shell
- In the
_server
directory, run the migrationspython manage.py migrate
- In the
client
directory runnpm run dev
- In the
_server
directory (with your poetry env activated) runpython manage.py runserver
- Visit your application at
http://localhost:8000
Then point the ASSET_URL to localhost:5173. This will prevent any possible headaches from favicon.io throwing possible errors in django.