Django Admin 自动填写日期字段
1 from django.db import models 2 import django.utils.timezone as timezone 3 class Doc(models.Model): 4 add_date = models.DateTimeField('保存日期',default = timezone.now) 5 mod_date = models.DateTimeField('最后修改日期', auto_now = True)
参考连接:https://www.cnblogs.com/huchong/p/7895263.html