CSS URL inspection fails

In several CSS files I have statements like:
background-image: url(/static/i/link-arrow.png);

With the static directory under my project root. Yet pycharm gives me a red
Cannot resvolve directory 'static'
inspection error.  How can I get pycharm to find my static files?
0
3 comments
Avatar
Permanently deleted user
Hi Bryce,

Is it a Django application?
Do you have your static directory set in STATICFILES_DIRS field in settings.py?
0
Avatar
Permanently deleted user
Yes, this is django:

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


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


Does this work for other people?
0
Avatar
Permanently deleted user
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.