admin.py文件里注册
admin.site.register(models.AuthInfo)
class Categories(models.Model): # 文章分类
name = models.CharField(max_length=32,verbose_name=‘文章分类‘)
blog = models.ForeignKey(to=‘Blog‘,null=True)
class Meta:
verbose_name_plural = ‘文章分类‘
db_table = ‘tb_categories’
def __str__(self):
return self.name
原文:https://www.cnblogs.com/plyc/p/14055445.html