Use django-suit to add a template for the django 1.7 admin background, django-suitdjango
It seems a bit problematic to use inline in django-grappelli. For another skin:
Django-suit is the second admin skin recommended by 2scoops.
Supports: Django 1.4-1.7. Python: 2.6-3.
The environment in this article is django 1.7.1
Django-suit Official Website
Installation Guide
Strategy
The translation is as follows:
Install
Copy codeThe Code is as follows:
Pip install django-suit
# Settings. py
From django. conf. global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
'Django. core. context_processors.request ',
)
Terminal
Copy codeThe Code is as follows:
Python manage. py makemigrations
Python manage. py migrate
Python manage. py collectstatic
Congratulations! The basic installation is complete!
There are still many detailed settings in the official strategy. I found that this plug-in is not only for background services, but also comes with many form widgets that can be used in the previous stage:
Example:
Datetime widget
Copy codeThe Code is as follows:
SuitDateWidget, SuitTimeWidget and extends original admin widgets by adding some additional output styling only. Widgets still uses same original JavaScript for calendar and time. You can see example in Demo app: User changeform:
From django. forms import ModelForm
From suit. widgets import SuitDateWidget, SuitTimeWidget, SuitSplitDateTimeWidget
Class UserChangeForm (UserChangeForm ):
Class Meta:
Model = User
Widgets = {
'Last _ login': SuitSplitDateTimeWidget,
'Date _ joined': SuitSplitDateTimeWidget,
}
Most of the above content is simplified to the official strategy. For more information, see.