注冊登陸
創(chuàng)建虛擬環(huán)境: mkvitualenv
安裝必要的puthon包 : pip install django==1.11
創(chuàng)建項目應(yīng)用,設(shè)置中文妓美、時區(qū)
設(shè)計數(shù)據(jù)庫,創(chuàng)建鲤孵、執(zhí)行遷移
在admin中注冊模型
from django.contrib import admin
from myapp.models import UserInfo
@admin.register(UserInfo)
class UserInfoAdmin (admin.ModelAdmin):
list_per_page =10(一頁顯示10條記錄)
創(chuàng)建超級管理員:python manage.py createsuperuser
......
<select> <option> </option> <option></option></select>創(chuàng)建有可點擊擴展的三角框
使用dango表單 django表單可以:1.準(zhǔn)備和重構(gòu)數(shù)據(jù)用于渲染前端頁面 2.為數(shù)據(jù)創(chuàng)建html表單元素 3.接收和處理用戶從表單發(fā)過來的數(shù)據(jù)