Add a template to the Django 1.7 admin background using Django-suit

Source: Internet
Author: User
Tags install django pip install django
Django-grappelli inside use inline seems a bit of a problem, change a skin:

Django-suit is the second admin skin recommended by 2scoops.
Supports:django 1.4-1.7. Python:2.6-3.
The environment for this article is Django 1.7.1

Django-suit official website
Installation Guide Links
Set up Raiders

Translation is handled as follows:

Installation

Copy the Code code 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 the Code code as follows:


Python manage.py makemigrations
Python manage.py Migrate
Python manage.py collectstatic

Congratulations! The basic installation is complete!

Official raiders also have a lot of detailed settings, I found that this plugin is not just for the back-end service, but also with a lot of form widgets, at the front desk can also be good use:
Examples are as follows:

DateTime widget

Copy the Code code as follows:


Suitdatewidget, Suittimewidget and Suitsplitdatetimewidget 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 reduced to the official guide, to the needs of the small partners to refer to it

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.