Make sure
Debug = True # in django settings.py file
create virtualenv
install requirements.txt
npm install
# now run
npm run dirt-dev
python manage.py runserver
Note: In this starterkit I have used Whitenoice for staticfile serve
Disable Debug in django settings.py file
Debug = False
Build React files
npm run vite-build
Run Django collectstatic
python manage.py collectstatic
Run Django server (in this case no need to run npm
command)
python manage.py runserver
Everyting should work like you expect.
Note: Now you can use Nginx, Gunicorn for production or any other technology you like for production.