7👍
✅
PyCharm 2.5 finds my static files again.
The trick is to mark app1/static and app2/static as “Source Root”.
STATICFILES_DIRS
is not working for me.
10👍
Go to Settings in Pycharm 2.73
Settings >> Project Setting >> Django
Enable the Django support and provide the paths for the three following files:
Project Root
Settings file
Manage.py file
When you have given these informations, close PyCharm and restart it.
👤A.J.
- Django: why are Django model fields class attributes?
- Django-Rest-Framework serializer class meta
- Align radio buttons horizontally in django forms
- Django rest framework nested viewsets and routes
1👍
The selected answer doesn’t work for me. What solved it is using a prefix in STATICFILES_DIRS:
STATICFILES_DIRS = (
# ...
("resources", "C:/data/django/myproject/myapp/static"), )
as documented in the django docs: https://docs.djangoproject.com/en/1.4/ref/contrib/staticfiles/
Then in your html template:
<link rel="stylesheet" href="{%static 'resources/favicon.png' %}" type="text/css">
0👍
STATICFILES_DIRS
works for
{% static "js/lib/jquery-1.8.2.min.js" %}
tag in template.
Not for {{ STATIC_URL }}js/lib/jquery-1.8.2.min.js
- Tag inside tag in django template
- Django CMS malfunction: Site matching query does not exist
- Django ALLOWED_HOSTS for Amazon ELB
Source:stackexchange.com