• Flask实践——microblog 环境搭建 & helloword (1)


    环境搭建 & helloword

    1. 创建项目目录,进入该目录
      mkdir microblog
      cd microblog
    2. 使用virtualen创建独立的运行环境
      virtualenv -p /usr/bin/python3 flask
    3. 进入环境
      source flask/bin/activate
    4. 安装相关模块及扩展
      $ flask/bin/pip install flask
      $ flask/bin/pip install flask-login
      $ flask/bin/pip install flask-openid
      $ flask/bin/pip install flask-mail
      $ flask/bin/pip install flask-sqlalchemy
      $ flask/bin/pip install sqlalchemy-migrate
      $ flask/bin/pip install flask-whooshalchemy
      $ flask/bin/pip install flask-wtf
      $ flask/bin/pip install flask-babel
      $ flask/bin/pip install guess_language
      $ flask/bin/pip install flipflop
      $ flask/bin/pip install coverage
    5. 构建Flask项目框架
      mkdir app
      mkdir app/static
      mkdir app/templates
      mkdir tmp
    6. 创建app/__init__.py
      from flask import Flask
      
      app = Flask(__name__)
      from app import views
    7. 创建app/views.py
      from app import app
      
      @app.route('/')
      @app.route('/index')
      def index():
          return "Hello, World!"
    8. 创建microblog/run.py
      #!flask/bin/python
      from app import app
      app.run(debug = True)
    9. 运行run.py
      http://localhost:5000

    源码

  • 相关阅读:
    hide the navigationBar and tabBar
    js
    CATranstion动画
    CASpringAnimation
    UIImageView动画
    打电话发短信
    页面滑动悬停在某个控件(两种做法)
    导航栏相关设置
    ASCII和16进制
    C++中,申请字符串数组可用new实现
  • 原文地址:https://www.cnblogs.com/lnkDel/p/8952439.html
Copyright © 2020-2023  润新知