-
数据模型
- 关于时间的字段设置
add_date = models.DateTimeField('保存日期',default = timezone.now)
mod_date = models.DateTimeField('最后修改日期', auto_now = True) -
关于路由
- django2中path 不能正常匹配正则路由,使用re_path代替即可。
from django.urls import re_path
数据模型
add_date = models.DateTimeField('保存日期',default = timezone.now)
mod_date = models.DateTimeField('最后修改日期', auto_now = True)
关于路由
from django.urls import re_path