pyramid setup
http://docs.pylonsproject.org/en/latest/docs/pyramid.html
首先得装python2.7。
其次装Python的虚拟机环境,也就是virtualenv。
然后创建Python虚拟机环境的目录。
然后写配置文件了。
然后就ok了。详情见下:
Virtualenv
Installation
If not already installed, install pip
sudo apt-get install python-pip
Next using pip to install virtualenv and virtualenvwrapper
sudo pip install virtualenv virtualenvwrapper
Create virtualenv directory
mkdir ~/.virtualenvs
make sure the path to virtualenvwrapper.sh
whereis virtualenvwrapper.sh
it should output something like:
virtualenvwrapper: /usr/local/bin/virtualenvwrapper.sh
edit ~/.bash_profile
to set environment variables
# Virtualenv Wrapper Setting export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/dev source /usr/local/bin/virtualenvwrapper.sh
add following line to the end of ~/.bashrc
source ~/.bash_profile
You have to exit the shell in order for the settings to take place or you can source /usr/local/bin/virtualenvwrapper.sh
manually
Usage
Create a new virtual environment with a specific Python version (the name here is “dev”)
mkvirtualenv -p python2.7 dev
Use PIP to install packages inside a virtual environment from a pip requirements file. (Enter VEnv first!)
pip install -r <my-requirements-file>
http://docs.pylonsproject.org/en/latest/docs/pyramid.html
当你搭建好pyramid的环境, 你就可以下载测试文件,或者使用自己的文件进行测试。
基本命令是,pserve development.ini运行服务器了。
重启服务器pserve --reload development.ini
合乎自然而生生不息。。。