上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页
摘要: 方式一:app.config['xx'] = 'xxx'源码分析:#第1步:class Flask(_PackageBoundObject): self.config = self.make_config(instance_relative_config) #第2步: def make_config(self, instance_relative=False): ... 阅读全文
posted @ 2018-01-19 16:49 Cool· 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 一 介绍 官网:http://selenium-python.readthedocs.io 二 安装 #安装:selenium+chromedriver pip3 install selenium 下载chromdriver.exe放到python安装路径的scripts目录中即可,注意最新版本是2 阅读全文
posted @ 2018-01-17 20:34 Cool· 阅读(1252) 评论(0) 推荐(0) 编辑
摘要: 启动先执行manage.py 中的 app.run() 执行app(),对象()表示调用对象的__call__方法 又调用了app.wsgi_app方法 第1步:执行app.request_context方法,把请求的相关信息传进去了 返回了一个RequestContext类的实例对象 在init构 阅读全文
posted @ 2018-01-17 17:36 Cool· 阅读(688) 评论(0) 推荐(0) 编辑
摘要: 1.爬虫的定义: 向网站发起请求,获取资源后分析并提取有用数据的程序 2.爬虫的基本流程: 3.格式: 4.简单示例: import requests #pip3 install requests import re import hashlib import time movie_path=r'C 阅读全文
posted @ 2018-01-16 16:30 Cool· 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 使用步骤: 阅读全文
posted @ 2018-01-16 15:50 Cool· 阅读(1466) 评论(0) 推荐(0) 编辑
摘要: scoped_session from sqlalchemy.orm import sessionmaker from sqlalchemy import create_engine from sqlalchemy.orm import scoped_session engine = create_engine( ... 阅读全文
posted @ 2018-01-16 12:00 Cool· 阅读(1408) 评论(0) 推荐(0) 编辑
摘要: SQLAlchemy-Utils,提供choice功能 定义: # pip3 install sqlalchemy-utils from sqlalchemy_utils import ChoiceType Base = declarative_base() c... 阅读全文
posted @ 2018-01-16 11:21 Cool· 阅读(1080) 评论(0) 推荐(0) 编辑
摘要: 1.模板继承 2.连接数据库 3.应用flask-session 其他的正常操作就可以了 阅读全文
posted @ 2018-01-16 00:22 Cool· 阅读(1265) 评论(0) 推荐(0) 编辑
摘要: SQLAlchemy 一. 介绍 SQLAlchemy是一个基于Python实现的ORM框架。该框架建立在 DB API之上,使用关系对象映射进行数据库操作,简言之便是:将类和对象转换成SQL,然后使用数据API执行SQL并获取执行结果。 pip3 install sqlalchemy 组成部分: 阅读全文
posted @ 2018-01-15 23:39 Cool· 阅读(811) 评论(0) 推荐(0) 编辑
摘要: 安装: pip3 install flask-script#!/usr/bin/env python # -*- coding:utf-8 -*- from flask_script import Manager, Server from flask import Flask app = Flask(__name__) manager = Manager(app) @manager.... 阅读全文
posted @ 2018-01-15 23:20 Cool· 阅读(2557) 评论(0) 推荐(1) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页