標籤:django python
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.第三版class ChoiceInline(admin.TabularInline):model = Choiceextra = 3class QuestionAdmin(admin.ModelAdmin):#1.第一版#fields = [‘pub_date‘,‘question_text‘]#2.第一版fieldsets=[(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
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
【3】依照django官網:建立一個web app