Flask入门教程这个命令会打印出当前计算机用户的名称。其他常用的命令还有 cd 命令,用来 切换目录(change directory); mkdir 命令,用来创建目录(make directory)。在不同的操作系统上,执行某个操作的命令可能会有所不同,在必要 的地方,书里会进行提示。 我们先来为我们的程序创建一个文件夹: $ mkdir watchlist $ cd watchlist 除非特别说明,从现 为了让页面不那么单调,我们来添加两个图片:一个是显示在页面标题旁边的头 像,另一个是显示在页面底部的龙猫动图。我们在 static 目录下面创建一个子文件 夹 images,把这两个图片都放到这个文件夹里: $ cd static $ mkdir images 创建子文件夹并不是必须的,这里只是为了更好的组织同类文件。同样的,如果你 有多个 CSS 文件,也可以创建一个 css 文件夹来组织他们。下面我们在页面模板 watchlist # 创建作为包的文件夹 $ mv static templates watchlist # 把 static 和 templates 文件夹移 动到 watchlist 文件夹内 $ cd watchlist # 切换进包目录 $ touch __init__.py views.py errors.py models.py commands.py # 创建多个模块 我们把0 码力 | 127 页 | 7.62 MB | 1 年前3
Flask Documentation (1.1.x)first. Create an environment Create a project folder and a venv folder within: $ mkdir myproject $ cd myproject $ python3 -m venv venv On Windows: $ py -3 -m venv venv If you needed to install virtualenv Project Layout. Project Layout Create a project directory and enter it: $ mkdir flask-tutorial $ cd flask-tutorial Then follow the installation instructions to set up a Python virtual environment and do these steps: 1. Create the directory structure in /var/www: $ mkdir /var/www/yourapplication $ cd /var/www/yourapplication $ virtualenv --distribute env 2. Upload a new application.wsgi file to the0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask Documentation (1.1.x)first. Create an environment Create a project folder and a venv folder within: $ mkdir myproject $ cd myproject $ python3 -m venv venv On Windows: $ py -3 -m venv venv If you needed to install virtualenv Tutorial 1.5.1 Project Layout Create a project directory and enter it: $ mkdir flask-tutorial $ cd flask-tutorial Then follow the installation instructions to set up a Python virtual environment and do these steps: 1. Create the directory structure in /var/www: $ mkdir /var/www/yourapplication $ cd /var/www/yourapplication $ virtualenv --distribute env 2. Upload a new application.wsgi file to the0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask-RESTful Documentation Release 0.3.10[https://github.com/flask-restful/flask-restful]. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 42 页 | 84.60 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.10be downloaded from its page at GitHub. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 39 页 | 212.29 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.6be downloaded from its page at GitHub. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 46 页 | 245.60 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.6[https://github.com/flask-restful/flask-restful]. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 49 页 | 91.90 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.7be downloaded from its page at GitHub. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 50 页 | 253.09 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.8be downloaded from its page at GitHub. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 50 页 | 253.64 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.8[https://github.com/flask-restful/flask-restful]. git clone https://github.com/flask-restful/flask-restful.git cd flask-restful python setup.py develop Flask-RESTful has the following dependencies (which will be0 码力 | 55 页 | 93.30 KB | 1 年前3
共 11 条
- 1
- 2













