0922自我总结 django后台管理-admin 一.模型注册 admin.py 注册方式一: #在对于注册的app中的admin文件中导入模型然后注册模型 admin.site.register(导入的模型类) 注册方式二该方法是Django1.7的版本新增的功能: from django.contrib import admin from blog.models import Blog #Blog模型的管理器 @admin.register(Blog) class BlogAdmin(ad
修改 admin.py from myapp.models import * from django.contrib import admin # Register your models here. admin.site.register(Mysite) 修改models from django.db import models # Create your models here. class Mysite(models.Model): title=models.CharField(max_l
from django.contrib import admin # Register your models here. import xlwt from django.http import HttpResponse from dal import models # Register your models here. from openpyxl import Workbook class FundAdmin(admin.ModelAdmin): actions = ["export_as_