Code Monkey home page Code Monkey logo

flasky's Introduction

Flasky

This repository contains the source code examples for the second edition of my O'Reilly book Flask Web Development.

The commits and tags in this repository were carefully created to match the sequence in which concepts are presented in the book. Please read the section titled "How to Work with the Example Code" in the book's preface for instructions.

For Readers of the First Edition of the Book

The code examples for the first edition of the book were moved to a different repository: https://github.com/miguelgrinberg/flasky-first-edition.


更新

首次启动流程

  • virtualenv venv #安装venv
  • source venv/bin/activate #进入venv环境
  • pip install -r requirements.txt #安装依赖包
  • export FLASK_APP=flasky.py #设置flask环境变量(也可通过dotenv的.env文件设置)
  • export FLASK_DEBUG=1 #设置flask环境变量(也可通过dotenv的.env文件设置)
  • flask deploy #DB升级+系统初始化数据
  • flask profile #启动server

变动记录

  1. 增加log相关调试(自定义日志Formatter,TimedRotatingFileHandler)
  2. 增加全局异常捕捉调试(@app.app_errorhandler(err_code_or_exception)全局异常捕捉)
  3. 测试路由的两种定义方式(@app.route()、app.add_url_rule())

根据表反向生成 sudo sqlacodegen sqlite:///path > modle.py

flasky's People

Contributors

miguelgrinberg avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.