CSS URL inspection fails

In several CSS files I have statements like:
background-image: url(/static/i/link-arrow.png);
prettyPrint();
With the static directory under my project root. Yet pycharm gives me a red
Cannot resvolve directory 'static'
prettyPrint(); inspection error.  How can I get pycharm to find my static files?
3 comments
Comment actions Permalink
Hi Bryce,

Is it a Django application?
Do you have your static directory set in STATICFILES_DIRS field in settings.py?
0
Comment actions Permalink
Yes, this is django:

STATICFILES_DIRS = (
    os.path.join(PROJECT_ROOT, 'obviously/static/'),
    os.path.join(PROJECT_ROOT, 'obviously/'), ) #Test PyCharm-1624
prettyPrint();

But the inspection is unhelpful, not listing the directories it tried to find the file:
Cannot resolve directory 'static' less... (Ctrl+F1) 
This inspection detects inappropriate values assigned to CSS attributes. For example, invalid measurement units or values out of range
prettyPrint();

Does this work for other people?
0
Comment actions Permalink
Newest Pycharm 3, old problems. Same issue here, Pycharm is unable to resolve the paths to static files (js/css/img).

Static files from project level static folder:

<link rel="stylesheet" href="{% static 'css/jquery-ui-1.10.3.custom.min.css' %}">
<script type="text/javascript" src="{% static 'js/jquery-ui-1.10.3.custom.min.js' %}"></script>

Pycharm has a little more luck with static files in app folders.
Working with Django 1.5.4
0

Please sign in to leave a comment.