Use Django-suit to add a template for the Django 1.7 admin background _python

Source: Internet
Author: User
Tags install django pip install django

Django-grappelli inside the use of 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 of this article is the Django 1.7.1

Django-suit official website
Installation Guide Link
Set Raiders

Translation is handled as follows:

Installation

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

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

Congratulations! The basic installation is complete!

Official introduction There are many detailed settings, I found that this plugin is not just for the background service, but also a lot of form widget, in the foreground can also be good to use:
Examples are as follows:

DateTime widget

Copy 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-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 to streamline to the official strategy, to the needs of the small partners under the reference bar

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.