您的位置:首页 > 编程语言 > Go语言

django 后台管理

2016-05-08 15:24 961 查看

修改 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_length=100)
url=models.URLField()
author=models.CharField(max_length=100)
num=models.IntegerField(max_length=10)

def __unicode__(self):
return self.title

class Meta:
ordering=['num']
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: