How to fix "Cannot resolve file" in django template.
In my django project I reference resources files like CSS and javascript. For all these files I get the inspection error, "Cannot resolve file <path>". My project directory structure is:
- root
- content
- resources
- css
- signup.css
- python
- webapp
- settings.py
- etc.
In my template I have links like this one:
<link rel="stylesheet" type="text/css" href="/resources/css/signup.css" />
In the above snippet, the path in href="" is highlighted and I get the "cannot resolve" error.
I've tried to add my resources directory as a content root, a template root, and I've tried adding it as a project directory. None of these fix the issue. Any idea what I'm doing wrong?
Thanks!
-Roberto.
Please sign in to leave a comment.
What is MEDIA_ROOT in your projects?
as your project is django project?
do you set working directory in configuration?
I'm running in to this too. I can't find anywhere in the UI where paths like these are configured. How is this supposed to work for those of us not using Django?