会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Apollo
Powered by
博客园
|
|
新随笔
|
|
|
管理
2019年2月22日
Python时间获取详解,Django获取时间详解,模板中获取时间详解(navie时间和aware时间)
摘要: 1.Python获取到的时间 2.Django项目下setting.py文件里 3.在Django模板中将一个UTC时间转换为本地时间 4.在model.py文件中写
阅读全文
posted @ 2019-02-22 15:41 阿波罗Apollo
阅读(642)
评论(0)
推荐(0)
编辑
解决跨域HttpResponseJsonCORS, HttpResponseCORS 返回字典数据
摘要: ``` !/usr/bin/python coding: UTF 8 import json from django.http import HttpResponse def HttpResponseJsonCORS(request,s): response = HttpResponse(s,con
阅读全文
posted @ 2019-02-22 15:03 阿波罗Apollo
阅读(232)
评论(0)
推荐(0)
编辑
python通过原生sql查询数据库(共享类库)
摘要: ``` !/usr/bin/python coding: UTF 8 """DB共享类库""" 使用此类,先实例化一个DataBaseParent_local对象,然后对象调用相应方法 from django.db import connection import MySQLdb db = MySQ
阅读全文
posted @ 2019-02-22 14:31 阿波罗Apollo
阅读(298)
评论(0)
推荐(0)
编辑
元组套元组转列表套字典数据格式
摘要: ``` #!/usr/bin/python # -*- coding: UTF-8 -*- import json # 原始数据 rows = (('apollo', 'male', '164.jpeg'), ('apollo', 'male', '')) # 表头 names = 'username gender pic'.split() # URL公共部分 fs_url = 'http:/...
阅读全文
posted @ 2019-02-22 14:25 阿波罗Apollo
阅读(152)
评论(0)
推荐(0)
编辑