I want to change certain css in admin django like base.css. Is it better to change directly in the django library? How can I override it in the best way?
It depends a lot of what you want to do. Though first of all: do not overwrite it in the Django admin directly. You got two options I think are reasonable:
{% block extrastyle %}{% endblock %}
django/contrib/admin/templates/admin/base.html
Media
admin.py
class MyModelAdmin(admin.ModelAdmin): class Media: js = ('js/admin/my_own_admin.js',) css = { 'all': ('css/admin/my_own_admin.css',) }
1.4m articles
1.4m replys
5 comments
57.0k users