Fügen Sie eine statische Datei in Django hinzu
STATICFILES_DIRS = [
BASE_DIR / "static",
'/var/www/static/',
]
Plain Pheasant
STATICFILES_DIRS = [
BASE_DIR / "static",
'/var/www/static/',
]
STATICFILES_DIRS = [
BASE_DIR / "static",
'/var/www/static/',
]
{% load static %}
<img src="{% static 'my_app/example.jpg' %}" alt="My image">