Add css js and image path in django

Websites generally need to serve additional files such as images, JavaScript, or CSS. In Django, we refer to these files as “static files”. Django provides django.contrib.staticfiles to help you manage them.

STATIC_URL = "static/"
{% load static %}
<img src="{% static 'my_app/example.jpg' %}" alt="My image">

 

 

 

 

 

 

 

Leave a Reply