1.准备数据 在models创建测试表 from django.db import models class Host(models.Model): hostname = models.CharField(max_length=32) # ip = models.GenericIPAddressField(protocol='ipv4') ip = models.CharField(max_length=32) port = models.IntegerField() 2.自动化生成数据 hos…