上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 30 下一页

2014年7月18日

datetime.timedelta

摘要: from django.utils import timezoneimport datetimetimezone.now()datetime.datetime(2014, 7, 18, 9, 42, 24, 531000, tzinfo=)timezone.now() -datetime.timed... 阅读全文

posted @ 2014-07-18 17:45 颓废的悠然 阅读(475) 评论(0) 推荐(0) 编辑

django1.6读书笔记一

摘要: reporter是Article中的一个外键,我们可以有多篇文章指向同一个reporter,然后通过使用article_set.all()就可以返回其所有的headline了,也可以添加条件来筛选。(r’^articles/(\d{4})/(\d{2})/(\d+)/$’, ’news.views.... 阅读全文

posted @ 2014-07-18 17:07 颓废的悠然 阅读(99) 评论(0) 推荐(0) 编辑

2014年7月16日

django email用法

摘要: 在settings里面设置EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL_PORT = 25EMAIL_HOST = 'smtp.163.com'EMAIL_HOST_USER = 'abcd@163.com'EM... 阅读全文

posted @ 2014-07-16 10:16 颓废的悠然 阅读(536) 评论(0) 推荐(0) 编辑

2014年7月8日

django ImageField用法

摘要: settings里的设置PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname('__file__')))MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')MEDIA_URL = '/med... 阅读全文

posted @ 2014-07-08 17:43 颓废的悠然 阅读(4430) 评论(1) 推荐(0) 编辑

2014年7月6日

django集成微博内容

摘要: 登录微博我的工具OK。分享sns网站的网址分享道。去上面获取代码就可。改版后叫微博秀 阅读全文

posted @ 2014-07-06 21:41 颓废的悠然 阅读(115) 评论(0) 推荐(0) 编辑

python读写zip文件

摘要: zipfile.ZipFile(fileName[, mode[, compression[, allowZip64]]]) fileName是没有什么疑问的了。 mode和一般的文件操作一样,'r'表示打开一个存在的只读ZIP文件;'w'表示清空并打开一个只写的ZIP文件,或创建一个只写的ZIP文... 阅读全文

posted @ 2014-07-06 11:25 颓废的悠然 阅读(3435) 评论(0) 推荐(0) 编辑

读写文件

摘要: txt文件的读文件的上传 阅读全文

posted @ 2014-07-06 10:43 颓废的悠然 阅读(113) 评论(0) 推荐(0) 编辑

2014年7月5日

生成pdf文件

摘要: 阅读全文

posted @ 2014-07-05 22:31 颓废的悠然 阅读(140) 评论(0) 推荐(0) 编辑

404渲染

摘要: 在templates下写一个404页面然后debug改为False,ALLOWED_HOSTS = ['*'] 阅读全文

posted @ 2014-07-05 19:38 颓废的悠然 阅读(101) 评论(0) 推荐(0) 编辑

单元测试

摘要: from django.test import TestCasefrom forms import ProductFormclass SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 always eq... 阅读全文

posted @ 2014-07-05 00:51 颓废的悠然 阅读(187) 评论(0) 推荐(0) 编辑

上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 30 下一页

导航