1STATIC_URL = '/static/'
2STATIC_ROOT = os.path.join(BASE_DIR, "/static/")
3
4STATICFILES_DIRS = (
5 STATIC_ROOT,
6)
7
1from django.conf import settings
2from django.conf.urls.static import static
3
4urlpatterns = [
5 # ... the rest of your URLconf goes here ...
6] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
7
1{% load static %}
2<img src="{% static "my_app/example.jpg" %}" alt="My image">
3