I'm trying to load my own css file to replace base.css in order to customize Django Admin
{% extends "admin/base.html" %}
{% load static %}
{% block title %}VSPM{% endblock %}
{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('Django administration') }}</a></h1>
{% endblock %}
{% block stylesheet %}{% static "admin/css/theme.min.css" %}{% endblock %}
{% block nav-global %}{% endblock %}
But the css file isn't loading in Django admin. What am I doing wrong?
{% block extrastyle %}{% static "admin/css/theme.min.css" %}{% endblock %}
更改您的块名称并尝试
/virualent_path//lib/python3.6/site-packages/django/contrib/admin/static/admin
to 'static' folder of your project.STATIC_ROOT = os.path.join(PROJECT_DIR, 'static')
python3.6 manage.py collectstatic
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.