STATICFILES_DIRS = [ BASE_DIR / "static", '/var/www/static/', ]
Project urls.py:-
from django.conf import settings from django.conf.urls.static import static urlpatterns = [ # ... the rest of your URLconf goes here ... ]+ static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)Or+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)Then load static file with format like:-{% load static %} <img src="{% static 'my_app/example.jpg' %}" alt="My image">
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALQ%3D5fyZPWiBGnY6VJB1_C6Rb1Ls4dfsGfTef%2BBSqi1BXKHtfw%40mail.gmail.com.
Hope you have this in the <head> section of your template.
<head>
{% load static %}
{% block head %}
<title>{{luserdetails.luserrolename}} | Aspirations </title>
{% endblock %}
</head>
--
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANMvxF0juEz51Pua5PRAR8uNjKPsSGVkZUnDYjTTtve7hfObag%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANMvxF0juEz51Pua5PRAR8uNjKPsSGVkZUnDYjTTtve7hfObag%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CANMvxF2ddJb5aHrK%3D88RRm40mxThRrCfUYjJyPBqkDWCCTWGwg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALQ%3D5fyRaoJWhNH5SrWsXi3cLr74jNyziOvc41%3DSdfDze-H9Ow%40mail.gmail.com.
--
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8ba41bbd-6a9e-4d79-936e-e9ff7ce53dafn%40googlegroups.com.