codecamp

Pyramid 环境搭建

Pyramid可以安装在Linux、MacOS以及Windows平台上。

但是建议将Pyramid包安装在安装了Python 3.6或以上版本的系统上。

最简单的安装方法是使用pip安装程序,最好是在Python虚拟环境下。

pip3 install pyramid

尽管Pyramid网络应用程序可以使用内置的WSGI开发服务器运行,它是 ​wsgiref ​模块的一部分,但不建议在生产环境中使用。因此,我们也安装了Waitress,一个具有生产质量的纯Python WSGI服务器(也是Pylons项目的一部分)。

pip3 install waitress

这将安装Pyramid(2.0版)、Waitress(2.1.2版)以及Pylon项目的其他依赖项,如WebOb、PasteDeploy和其他。要检查安装的内容,请运行​ pip freeze ​命令。

pip3 freeze
hupper==1.10.3
PasteDeploy==2.1.1
plaster==1.0
plaster-pastedeploy==0.7
pyramid==2.0
translationstring==1.4
venusian==3.0.0
waitress==2.1.2
WebOb==1.8.7
zope.deprecation==4.4.0
zope.interface==5.4.0


Pyramid 概述
Pyramid Hello World
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }