总是觉的学习东西有点猴子掰玉米的感觉。今天就重新再掰一次吧。

Installation:

安装之前建议先安装virtualenv,这个东东是帮助你在多个python版本之间保持同步,不至于python版本变化了,项目就奔溃了。

某些程序猿的装备好些,可能用的是mac,自有类linux的安装方法。无奈本屌丝只能在win下来写写程序。所以只提供win的virtualenv安装方法:

到这里下载http://flask.pocoo.org/docs/installation/#windows-easy-install, 创建python 文件,拷贝 distribute_setup.py的内容。然后双击即可。

也可参考这篇文章,非常详细:http://f.dataguru.cn/thread-36396-1-1.html

1. 安装pip : easy_install.py pip

2. 安装virtualenv: easy_install.py virtualenv

安装完成记得在环境变量里面添加路径。

APP:

现在新创建一个文件夹,给这个文件夹设置python环境。

F:\>cd flask

F:\flask>cd picshow

F:\flask\picshow>virtualenv env
New python executable in env\Scripts\python.exe
Installing Setuptools...........................................................
................................................................................
................................................................................
.......................done.
Installing Pip..................................................................
................................................................................
................................................................................
................................................................................
.....................done. F:\flask\picshow>

接下来激活这个环境

env\Scripts\activate

最后,为应用添加Flask:

F:\flask\picshow>env\Scripts\activate
(env) F:\flask\picshow>pip install Flask
Downloading/unpacking Flask
Downloading Flask-0.10.1.tar.gz (544kB): 544kB downloaded
Running setup.py egg_info for package Flask warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
no previously-included directories found matching 'docs\_themes\.git'
Downloading/unpacking Werkzeug>=0.7 (from Flask)
Downloading Werkzeug-0.9.4.tar.gz (1.1MB): 1.1MB downloaded
Running setup.py egg_info for package Werkzeug warning: no files found matching '*' under directory 'werkzeug\debug\templat
es'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
Downloading/unpacking Jinja2>=2.4 (from Flask)
Downloading Jinja2-2.7.1.tar.gz (377kB): 377kB downloaded
Running setup.py egg_info for package Jinja2 warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
warning: no previously-included files matching '*.pyc' found under directory
'jinja2'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'jinja2'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
Downloading/unpacking itsdangerous>=0.21 (from Flask)
Downloading itsdangerous-0.23.tar.gz (46kB): 46kB downloaded
Running setup.py egg_info for package itsdangerous warning: no previously-included files matching '*' found under directory 'do
cs\_build'
Downloading/unpacking markupsafe (from Jinja2>=2.4->Flask)
Downloading MarkupSafe-0.18.tar.gz
Running setup.py egg_info for package markupsafe Installing collected packages: Flask, Werkzeug, Jinja2, itsdangerous, markupsafe Running setup.py install for Flask warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
no previously-included directories found matching 'docs\_themes\.git'
Running setup.py install for Werkzeug warning: no files found matching '*' under directory 'werkzeug\debug\templat
es'
warning: no files found matching '*' under directory 'tests'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
warning: no previously-included files matching '*.pyc' found under directory
'tests'
warning: no previously-included files matching '*.pyo' found under directory
'tests'
warning: no previously-included files matching '*.pyc' found under directory
'examples'
warning: no previously-included files matching '*.pyo' found under directory
'examples'
no previously-included directories found matching 'docs\_build'
Running setup.py install for Jinja2 warning: no files found matching '*' under directory 'custom_fixers'
warning: no previously-included files matching '*' found under directory 'do
cs\_build'
warning: no previously-included files matching '*.pyc' found under directory
'jinja2'
warning: no previously-included files matching '*.pyc' found under directory
'docs'
warning: no previously-included files matching '*.pyo' found under directory
'jinja2'
warning: no previously-included files matching '*.pyo' found under directory
'docs'
Running setup.py install for itsdangerous warning: no previously-included files matching '*' found under directory 'do
cs\_build'
Running setup.py install for markupsafe building 'markupsafe._speedups' extension
==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Failure information, if any, is above.
Retrying the build without the C extension now. ==========================================================================
WARNING: The C extension could not be compiled, speedups are not enabled.
Plain-Python installation succeeded.
==========================================================================
Successfully installed Flask Werkzeug Jinja2 itsdangerous markupsafe
Cleaning up... (env) F:\flask\picshow>

最新文章

  1. nginx ssl 更换问题
  2. uva 107 - The Cat in the Hat
  3. ios读取通讯录信息
  4. TI的AM3359的sd卡分区以及sd卡启动说明
  5. storm-starter项目概述
  6. JAVA正则忽略大小写
  7. How to face setbacks
  8. Http的Post和Get
  9. JAVA学习:异常
  10. ubuntu 系统 更改屏幕亮度为最大(15级亮度)
  11. Spark源码剖析(七):Job触发流程原理与源码剖析
  12. Ubuntu安装使用latex
  13. luogu3292 幸运数字 (点分治+线性基)
  14. Tensorflow object detection API 搭建物体识别模型(二)
  15. Linux touch命令详解
  16. zabbix宏(macro)使用:自定义监控阈值
  17. Visual Studio 2013/2015/2017快捷键(转)
  18. JSTL XML标签库 使用
  19. 【数组】Container With Most Water
  20. 牛客网国庆集训派对Day4题目 2018年

热门文章

  1. 「C++11」Lambda 表达式
  2. 正则表达式 判断 ip:端口 形式
  3. java Timer 定时每天凌晨1点执行任务
  4. MySQL延迟复制--percona-toolkit和MASTER TO MASTER_DELAY
  5. Document对象操作、样式、属性、效果、
  6. 关于python数据序列化的那些坑
  7. Counter Mode ( CTR )
  8. 替换Jar包里文件
  9. 网站开启https后加密协议始终是TLS1.0如何配置成TLS1.2?
  10. Andriod学习笔记5:通过NDK在C++中实现日志输出