上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页
摘要: from django.db import transaction @transaction.atomic()def page_trans(request): """ 事务练习 发布微博 顺便发布一条评论 """ user = WeiboUser.objects.get(pk=1) # 发布微博 w 阅读全文
posted @ 2019-09-06 12:33 EricBlog 阅读(120) 评论(0) 推荐(0) 编辑
摘要: """ ORM 查询练习 """# lisi_list = WeiboUser.objects.filter(username='lisi')# 不区分大小写# lisi_list = WeiboUser.objects.filter(username__icontains='lisi')# 严格区 阅读全文
posted @ 2019-09-05 21:28 EricBlog 阅读(195) 评论(0) 推荐(0) 编辑
摘要: # python manage.py check# python manage.py makemigrations# python manage.py migrate# python manage.py startapp mall 创建项目模块# 修改 1 ‘’ 阅读全文
posted @ 2019-09-05 09:19 EricBlog 阅读(79) 评论(0) 推荐(0) 编辑
摘要: <h5>字符串</h5><ol> {% for item in list_word %}{# 所有大写#}{# <li>{{ item|upper }}</li> #}{# 所有小写#}{# <li>{{ item|lower }}</li> #} {# 首字符大写#}{# <li>{{ item| 阅读全文
posted @ 2019-09-02 15:44 EricBlog 阅读(118) 评论(0) 推荐(0) 编辑
摘要: def templ_tag(resquest): """ 模板引擎标签 """ list_city = ('长沙', '广州', '深圳') list_prods = [ {"name": "名称1", 'price': 100}, {"name": "名称2", 'price': 200}, {" 阅读全文
posted @ 2019-09-02 13:47 EricBlog 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 安装 pip install jinja2 配置模板 阅读全文
posted @ 2019-09-02 10:10 EricBlog 阅读(165) 评论(0) 推荐(0) 编辑
摘要: from datetime import datetimefrom django.http import HttpResponse, HttpResponseRedirectfrom django.shortcuts import render,render_to_response,redirect 阅读全文
posted @ 2019-08-30 09:51 EricBlog 阅读(111) 评论(0) 推荐(0) 编辑
摘要: pip install django python import django django.__version__ 查看版本 '2.2.3' pip uninstall django 卸载 安装指定版本 pip install django==1.11.18 django-admin.py sta 阅读全文
posted @ 2019-08-29 14:56 EricBlog 阅读(100) 评论(0) 推荐(0) 编辑
摘要: https://api.mongodb.com/python/current/tutorial.html# 文档地址from pymongo import MongoClientfrom gridfs import *client = MongoClient(host = "localhost", 阅读全文
posted @ 2019-08-28 10:46 EricBlog 阅读(596) 评论(0) 推荐(0) 编辑
摘要: pip install pymongo 单行写入 5d63770002712ae609b67e61 Jack5d64c68516dce5bd516c0de2 李璐5d64c68516dce5bd516c0de3 陈刚5d64c68516dce5bd516c0de4 郭丽丽 5d64c68516dce 阅读全文
posted @ 2019-08-27 16:28 EricBlog 阅读(177) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 35 下一页