Flask Documentation (1.1.x)
Caution Installation Python Version Dependencies Virtual environments Install Flask Install virtualenv Quickstart A Minimal Application What to do if the Server does not Start Debug Mode Routing Static Open a Shell Environments Debug Mode Environment Variables From dotenv Environment Variables From virtualenv Custom Commands Plugins Custom Scripts PyCharm Integration Development Server Command Line In version of Python, you can continue on to the next section. If you’re using Python 2, see Install virtualenv first. Create an environment Create a project folder and a venv folder within: $ mkdir myproject0 码力 | 428 页 | 895.98 KB | 1 年前3Flask Documentation (1.1.x)
version of Python, you can continue on to the next section. If you’re using Python 2, see Install virtualenv first. Create an environment Create a project folder and a venv folder within: $ mkdir myproject needed to install virtualenv because you are using Python 2, use the following command instead: 1.3. Installation 5 Flask Documentation (1.1.x), Release 1.1.4 $ python2 -m virtualenv venv On Windows: Windows: > \Python27\Scripts\virtualenv.exe venv Activate the environment Before you work on your project, activate the corresponding environment: $ . venv/bin/activate On Windows: > venv\Scripts\activate0 码力 | 291 页 | 1.25 MB | 1 年前3Flask入门教程
解释器环境,使用它的好处如下: 保持全局环境的干净 指定不同的依赖版本 方便记录和管理依赖 我们将使用 Pipenv 来创建和管理虚拟环境、以及在虚拟环境中安装和卸载依赖 包。它集成了 pip 和 virtualenv,可以替代这两个工具的惯常用法。另外,它还集 成了 Pipfile,它是新的依赖记录标准,使用 Pipfile 文件记录项目依赖,使用 Pipfile.lock 文件记录固定版本的依赖列表。这两个文件替代了手动通过 命令即可为当前项 目创建一个虚拟环境: $ pipenv install 这个命令执行的过程包含下面的行为: 为当前目录创建一个 Python 解释器环境,按照 pip、setuptool、virtualenv 等 工具库。 如果当前目录有 Pipfile 文件或 requirements.txt 文件,那么从中读取依赖列表 并安装。 如果没有发现 Pipfile 文件,就自动创建。 创建虚拟环境后,我们可以使用 虚拟环境 为了让程序正确运行,我们需要在 Virtualenv 部分填入虚拟环境文件夹的路径: 第 11 章:部署上线 121 使用 Pipenv 时,你可以在项目根目录下使用下面的命令获取当前项目对应的虚拟 环境文件夹路径(返回前面打开的命令行会话输入下面的命令): $ pipenv --venv 复制输出的路径,点击 Virtualenv 部分的红色字体链接,填入并保存。 静态文件0 码力 | 127 页 | 7.62 MB | 1 年前3Flask-RESTful Documentation Release 0.3.10
URL if valid. ValueError Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 42 页 | 84.60 KB | 1 年前3Flask-RESTful Documentation Release 0.3.10
governing this project. 3.1 Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 39 页 | 212.29 KB | 1 年前3Flask-RESTful Documentation Release 0.3.6
governing this project. 3.1 Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 46 页 | 245.60 KB | 1 年前3Flask-RESTful Documentation Release 0.3.6
valid. Raises: ValueError Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 49 页 | 91.90 KB | 1 年前3Flask-RESTful Documentation Release 0.3.7
governing this project. 3.1 Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 50 页 | 253.09 KB | 1 年前3Flask-RESTful Documentation Release 0.3.8
governing this project. 3.1 Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 50 页 | 253.64 KB | 1 年前3Flask-RESTful Documentation Release 0.3.8
URL if valid. ValueError Running the Tests A Makefile is included to take care of setting up a virtualenv for running tests. All you need to do is run: $ make test To change the Python version used to0 码力 | 55 页 | 93.30 KB | 1 年前3
共 11 条
- 1
- 2