How can I get PyCharm to recognize the static files?
pycharm, python
Solution
You need to set the following settings, to tell PyCharm where to find the project root:
Django settings to set (image)
You can also use {{STATIC_URL}}/path/to/files, which works different by pycharm
This worked wonders. It is a bit strange of pycharm though.
Problem
I have one Django project that looks like: ``` /.idea /clients /app /static coin.png /templates index.html __init__.py urls.py /clients settings.py manage.py ``` In index.html I have (I can see the image on render): ``` {% load staticfiles %} <img src="{% static 'coin.png' %}"> ``` Relevant parts of settings.py: ``` STATIC_ROOT = os.path.join(os.path.dirname(__file__), 'static/') STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(os.path.dirname(__file__), '../static/'), ) INSTALLED_APPS = ( 'django.contrib.staticfiles', ) TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.static', ) ``` In project structure I've added `/clients` since the root of the Django project is one level up from the repo root. However all my `{% static %}` uses in this project keep getting highlights as not existing even though Django can find them. Ideas on how to resolve this?