django-vitevue
django-vitevue copied to clipboard
404 error when I refresh page
I've managed to succesfully build and run django, vue app with django-vitevue but now when I try to refresh the page, i get a 404 page not found error?? how can I resolve that?
Same here too. My url contains '/static/frontend/' between base url and page, something like 'localhost:8000/static/frontend/about'. How about yours? Did I miss something? I look into all the vite config, but could not fix it.
Sorry @HAFTSTUDIO I did not see the issue before. It looks like it is related to the base
param in vite config. In production the compiled js is served from a static directory. I have a full working example in this repo and can explain from this code:
- First check your compilation destination in the command in package.json: here I compile the files directly to a Django static directory, which will be served in production under the /static/frontend url
- Then check the
base
parameter in vite config and set it accordingly: here I set it to /static/frontend but it should be the url of where you placed the compilation result
I am facing the following issue. I am using Windows 11, python 3.10
Could not find platform independent libraries <prefix>
Unknown command: 'viteconf'
Type 'manage.py help' for usage.