![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
巴基搞比利
这个作者很懒,什么都没留下…
展开
-
Error: You must either define the environment variable DJANGO_SETTINGS_MODULE...
IDEA或PyCharm运行Django项目报错Error: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings 几个主要的检查点: 检查Run Configurations里面Environment variable,有没有DJANGO_SETTINGS_MODULE配置 检查Project Struc原创 2020-05-20 13:59:30 · 821 阅读 · 0 评论 -
Django字典与索引检索
建立一个字典类型: record_position = {} 循环给字典赋值,索引是某个position_id: for row in range(0, nrows): ... record_position[camera.position_id] = happen_date 从数据库取一列工单数据与字典进行比较,判断的是字典的索引里如果不含有某个position_id则执行下一步。用的是__contains__对字典索引进行检索: pending_tickets = SecuTicket.obje原创 2020-05-13 16:43:37 · 255 阅读 · 0 评论