Django Study Notes (6): Django Site Management

Source: Internet
Author: User

1. Django Site Management

It is really convenient and you don't have to develop it on your own, but it is often the enterprise-level background. I feel that the functions and beautification of the Django site background are not very good. Here is an article [Use grappelli to beautify the Django Admin background management interface]

You can try it.

2. Preparations

Because we need to use an automated site management tool (django. contrib. admin), we 'd better understand Django. contrib. What is it? It is a powerful function package and a standard library of Django. It consists of the following components:

Read this article here:

From: Using django. contrib package. Each sub-package is an independent additional feature package. These sub-packages are generally independent from each other, but some django. contrib sub-packages need to depend on other sub-packages. The function type is not mandatory in django. contrib. Some packages contain models (so you need to install the corresponding data tables in the database), but others are composed of independent middleware and template labels. The common feature of django. contrib Development Kit is: Even if you delete the entire django. contrib Development Kit, you can still use the basic functions of Django without any problems. When Django developers add new functions to the framework, they will strictly follow this principle to decide whether to add the new functions to django. contrib. Django. contrib is composed of the following development kits: admin: An automated site management tool. See Chapter 1. Admindocs: provides automatic documentation for the Django admin site. This book does not introduce this knowledge. For more information, see the Django official documentation. Auth: Django's user verification framework. See Chapter 1. Comments: A Comment application. Currently, this application is under intense development. Therefore, a complete description cannot be provided during the publication of this book, for more information about this application, see the official website of Django. this book does not introduce this knowledge. For more information, see the Django official documentation. Contenttypes: this is a framework used to introduce document types. Each installed Django module serves as an independent document type. This framework is mainly used by other applications in Django. It is mainly intended for Django's senior developers. You can read the source code to learn more about this framework. The source code is located in django/contrib/contenttypes /. Csrf: This module is used to defend against Cross-Site Request Forgery (CSRF ). See the section titled "CSRF defense. Databrowse: Django application that helps you browse data. This book does not introduce this knowledge. For more information, see the Django official documentation. Flatpages: a module that manages a single HTML content in a database. See the section titled "Flatpages. Formtools: some advanced libraries that process common forms of columns. This book does not introduce this knowledge. For more information, see the Django official documentation. Gis: provides GIS (Geographic Information Systems) Support for Django. For example, it allows your Django model to store geographic data and perform geographic queries. This library is complex and is not described in detail in this book. See the document on http://geodjango.org. Humanize: A series of Django module filters used to increase the humanization of data. Refer to the "humanized data" section later. Localflavor: A hybrid code segment for different countries and cultures. For example, it contains a method to verify the zip code of the United States and the ID card number of Ireland. Markup: A series of Django template filters used to implement some common markup languages. Refer to the subsequent section mark filter. Redirects: the framework used to manage redirection. See the "redirection" section later. Sessions: Django session framework. See chapter 14. Sitemaps: the framework used to generate XML files for website maps. See Chapter 13. Sites: a framework that allows you to manage multiple websites in the same database and Django installation. See the next section: syndication: a framework that uses RSS and Atom to generate an aggregate subscription source. See Chapter 13. Webdesign: Django extensions that are useful to designers. When writing this article, it only contains one template tag {% lorem % }. For more information, see the Django documentation. This chapter will describe in detail the django. contrib development kit content that has not been introduced before.

Step 3

1. settings file operations:

(1) INSTALLED_APPSTo add:Django. contrib. admin,Django. contrib. auth,Django. contrib. contenttypes,Django. contrib. sessions

(2 ),MIDDLEWARE_CLASSESContains'Django. middleware. common. CommonMiddleware','Django. contrib. sessions. middleware. SessionMiddleware'And'Django. contrib. auth. middleware. AuthenticationMiddleware'.

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.