"To start using the virtual environment, you have to “activate” it. If you are using a bash command line (Linux and Mac OS X users), you can activate the virtual environment with this command:"
"When a virtual environment is activated, the location of its Python interpreter is added to the PATH, but this change is not permanent; it affects only your current command session. To remind you that you have activated a virtual environment, the activation command modifies the command prompt to inc"
"When you are done working with the virtual environment and want to return to the global Python interpreter, type deactivate at the command prompt."
"The name argument that is passed to the Flask application construc‐ tor is a source of confusion among new Flask developers. Flask uses this argument to determine the root path of the application so that it later can find resource files relative to the location of the application."
"PyCharm 2016.1 or 2016.2:Settings,Tools,Terminal, and add""/K <path-to-your-activate.bat>""toShell path and add (mind the quotes). Also add quotes around cmd.exe, resulting in: `"cmd.exe" /k ""C:\mypath\my-venv\Scripts\activate.bat""`"
"Web服务器网关接口(Python Web Server Gateway Interface,缩写为WSGI)是为Python语言定义的Web服务器和Web应用程序或框架之间的一种简单而通用的接口。自从WSGI被开发出来以后,许多其它语言中也出现了类似接口。WSGI是作为Web服务器与Web应用程序或应用框架之间的一种低级别的接口,以提升可移植Web应用开发的共同点。WSGI是基于现存的CGI标准而设计的。 WSGI区分为两个部份:一为“服务器”或“网关”,另一为“应用程序”或“应用框架”。在处理一个WSGI请求时,服务器会为应用程序提供环境资讯及一个回呼函数(Callback Functio"
"Why is that? The application will work even with __name__, thanks to how resources are looked up. However it will make debugging more painful. Certain extensions can make assumptions based on the import name of your application. For example the Flask-SQLAlchemy extension will look for the code in yo"
作者简介
【作者简介】
米格尔•格林贝格(Miguel Grinberg)
近30年开发经验的软件工程师,以撰写Python项目开发的博客而广为Python开发者所熟知,经常受邀在PyCon等大会上分享开发经验。
【译者简介】
安道
专注于现代计算机技术的自由翻译,译有《流畅的Python》《Python网络编程攻略》《Ruby on Rails教程》等书。