创建表: from django.db import models class Publisher(models.Model): pid = models.AutoField(primary_key = True) name = models.CharField(max_leng=32, uniqure=True) def __str__(self): return self.name 模板字符串循环: {% for i in (循环对象) %} {{forloop.counter}} # 循环…