"3" according to Django website: Create a web App

Source: Internet
Author: User

1 Creating an Admin user

$ python manage.py createsuperuser
Username:wuwh

Password:ganbare


2 Start The development server?

$ python manage.py runserver 8088
visit:http://127.0.0.1:8000/admin/
3. Make the poll app modifiable in the admin
From Django.contrib import admin# Register your models here.from. Models import question,choice#3. Third Edition class Choiceinline (a DMin. Tabularinline):Model = ChoiceExtra = 3class questionadmin (admin. Modeladmin):#1. First edition#fields = [' pub_date ', ' Question_text ']#2. First editionfieldsets=[(none,{' Fields ': [' Question_text ']}),(' Date information ', {' Fields ': [' pub_date '], ' classes ': [' Collapse ']}),]Inlines = [Choiceinline]List_display = (' Question_text ', ' pub_date ', ' was_published_recently ')List_filter = [' Pub_date ']Search_fields = [' Question_text ']admin.site.register (question,questionadmin)

? $$ python manage.py createsuperuser

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"3" according to Django website: Create a web App

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.