The management interface of Python learning--django--django

Source: Internet
Author: User

The path to the admin interface is usually set in My_project, using django-admin.py startproject my_project

In the urls.py file in the directory, you can see

From Django.conf.urls import include, urlfrom django.contrib import adminurlpatterns = [    # Examples:    # URL (r ' ^$ ', ' My_project.views.home ', name= ' home '),    # URL (r ' ^blog/', include (' Blog.urls ')),    URL (r ' ^admin/', include ( Admin.site.urls)),    URL (r ' ^$ ', ' my_project.views.first_page '),    url (r ' ^app1/', include (' App1.urls ')),]
The data model student to admin management interface management, you need to register the model in admin

In the app's admin.py, add:

From Django.contrib import adminfrom app1.models import student# Register your models Here.admin.site.register (Student)

Visit http://localhost:8000/admin/

After landing, we can manage our model.

You can see that you can also manage users and groups


The interface of the Chinese is very simple, only need to setting.py in the Language_code = 'en-us ' modified to ZH-CN



The management interface of Python learning--django--django

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.