0

I am serving my vuejs SPA in django at /app/

Serving static files at /static/

My app is working fine served in django development, but, collectstatic fails.

My vue.config.js has:

module.exports = {
    assetsDir: 'static',
}

Compiled CSS files have font urls like this:

url(../../static/fonts/materialdesignicons-webfont.ee2bb9f3.eot

This works in the browser because it can't go up 2 dirs but in the filesystem goes up 2 dirs instead of one.

Works fine in the browser, but can't be deployed. It throws SuspiciousFileOperation exceptions:

django.core.exceptions.SuspiciousFileOperation: The joined path (/mnt/c/Users/static/fonts/materialdesignicons-webfont.ee2bb9f3.eot) is located outside of the base path component (/mnt/c/Users/fede_/braced/staticfiles)

I am really stuck with this.

echefede
  • 497
  • 4
  • 13
  • Why are you prefixing the path with `../`? – Daniel Roseman Feb 14 '19 at 11:27
  • I had `publicPath: '/app/'` too. Now, I have the same issue with `publicPath:'/'` and `assetsDir: 'static'`. It's maybe a problem with webpack. The compiled css has font routes like this: `url(../../static/fonts/materialdesignicons-webfont.ee2bb9f3.eot`. Even without `../` in `assetsDir`. This works in development but collectstatic goes up two dirs instead of one. – echefede Feb 14 '19 at 11:43

0 Answers0