Django18初体验
1416 浏览 5 years, 11 months
10 Admin
版权声明: 转载请注明出处 http://www.codingsoho.com/将自己的模块加入管理工具中,这样我们就能够通过这个漂亮的界面添加、修改和删除数据库中的对象了。
在Admin中注册SignUp
from django.contrib import admin
from .models import SignUp
admin.site.register(SignUp, SignUpAdmin)
model将会显示在admin中
Customize admin
from django.contrib import admin
# Register your models here.
from .models import SignUp
class SignUpAdmin(admin.ModelAdmin):
list_display = ["__unicode__", "timestamp", "updated"]
class Meta:
model = SignUp
admin.site.register(SignUp, SignUpAdmin)