Our django server is our API as well as an operations backend. I'm working on improving our ops backend by writing a Vue SPA that slowly replaces the existing ops backend.
I'm frontend and a little lost in intricacies of Django configs. Could someone suggest a sane solution for this problem?
I would like for the app to be served out of static folder, and have set:
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
os.path.join(BASE_DIR, '../console/dist'),
)
This works and I can see my code when I view source, but only at http://localhost:8000/static/console/index.html
1) this won't work because as a SPA, Vue needs control of routing. From the Django side how can I have /static/console/* use my Vue app? On the Vue end, what do I have to configure in Webpack and Vue-router?
2) despite the fact that I can see my compiled app source, I get errors:
Creating Application Cache with manifest http://localhost:8000/static/appcache/manifest.appcache
index.html:1 Application Cache Checking event
index.html:1 Application Cache Downloading event
index.html:1 Application Cache Progress event (0 of 7) http://localhost:8000/favicon.ico
index.html:1 Application Cache Error event: Resource fetch failed (4) http://localhost:8000/favicon.ico
index.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker: A bad HTTP response code (404) was received when fetching the script.
which is weird because http://localhost:8000/favicon.ico is a working URL. I have a feeling this is also a Webpack problem.
What are my options?