This is my first post about a web framework called
Pylons.I will describe in this post a quick and maybe dirty way of installing Pylons as a non privileged user on
Ubuntu 7.10.
The first thing that must be done is to install the following dependencies:
So launch your favorite terminal an type the command lines below (you will have to supply your password and to answer yes/no questions).
sudo apt-get install python-dev
sudo apt-get install python-setuptools
Then let's setup a development directory for python in your home directory thanks to the following command:
mkdir -p $HOME/dev/python
The next step consists in adding a PYTHONPATH variable and a PATH variable to your .bashrc file:
echo 'export PYTHONPATH=$HOME/dev/python/:$PYTHONPATH' >> ~/.bashrc
echo 'export PATH=$HOME/dev/python:$PATH' >> ~/.bashrc
Now you are ready to install Pylons:
easy_install --install-dir=$HOME/dev/python Pylons
The previous command will print in your terminal some logs like the following ones:
Creating /home/dma/dev/python/site.py
Searching for Pylons
Reading http://cheeseshop.python.org/pypi/Pylons/
Reading http://cheeseshop.python.org/pypi/Pylons/0.9.6.1
Reading http://www.pylonshq.com/
Reading http://cheeseshop.python.org/pypi/Pylons/0.9.4.1
Reading http://cheeseshop.python.org/pypi/Pylons/0.9.6
Reading http://cheeseshop.python.org/pypi/Pylons/0.9.5
Best match: Pylons 0.9.6.1
Downloading http://pypi.python.org/packages/source/P/Pylons/Pylons-0.9.6.1.tar.gz#md5=1341f0ab5680742ff1caa80da10751b4
Processing Pylons-0.9.6.1.tar.gz
Running Pylons-0.9.6.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-8nbOHD/Pylons-0.9.6.1/egg-dist-tmp-q0L0NN
Adding Pylons 0.9.6.1 to easy-install.pth file
Installed /home/dma/dev/python/Pylons-0.9.6.1-py2.5.egg
Reading http://www.pylonshq.com/download/
Processing dependencies for Pylons
Searching for Mako>=0.1.8
Best match: Mako 0.1.8
Downloading http://pylonshq.com/download/0.9.6.1/Mako-0.1.8.tar.gz
Processing Mako-0.1.8.tar.gz
Running Mako-0.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-6n_ZMr/Mako-0.1.8/egg-dist-tmp-12h9pt
Adding Mako 0.1.8 to easy-install.pth file
Installed /home/dma/dev/python/Mako-0.1.8-py2.5.egg
Searching for nose>=0.9.3
Reading http://cheeseshop.python.org/pypi/nose/
Reading http://somethingaboutorange.com/mrl/projects/nose/
Reading http://cheeseshop.python.org/pypi/nose/0.10.0
Best match: nose 0.10.0
Downloading http://somethingaboutorange.com/mrl/projects/nose/nose-0.10.0.tar.gz
Processing nose-0.10.0.tar.gz
Running nose-0.10.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-29HQ-U/nose-0.10.0/egg-dist-tmp-5xM5c8
zip_safe flag not set; analyzing archive contents...
nose.suite: module references __path__
nose.loader: module references __path__
nose.util: module references __file__
nose.importer: module references __file__
nose.importer: module references __path__
nose.inspector: module MAY be using inspect.findsource
nose.plugins.doctests: module references __file__
nose.plugins.cover: module references __file__
nose.ext.dtcompat: module references __file__
nose.ext.dtcompat: module MAY be using inspect.getsourcefile
Adding nose 0.10.0 to easy-install.pth file
Installing nosetests script to /home/dma/dev/python
Installed /home/dma/dev/python/nose-0.10.0-py2.5.egg
Searching for decorator>=2.1.0
Reading http://cheeseshop.python.org/pypi/decorator/
Reading http://www.phyast.pitt.edu/~micheles/python/documentation.html
Reading http://cheeseshop.python.org/pypi/decorator/2.2.0
Best match: decorator 2.2.0
Downloading http://www.phyast.pitt.edu/~micheles/python/decorator-2.2.0.zip
Processing decorator-2.2.0.zip
Running setup.py -q bdist_egg --dist-dir /tmp/easy_install-1TIz60/egg-dist-tmp-bmLIds
zip_safe flag not set; analyzing archive contents...
Adding decorator 2.2.0 to easy-install.pth file
Installed /home/dma/dev/python/decorator-2.2.0-py2.5.egg
Searching for simplejson>=1.7.1
Best match: simplejson 1.7.1
Downloading http://pylonshq.com/download/0.9.6.1/simplejson-1.7.1-py2.5.egg
Processing simplejson-1.7.1-py2.5.egg
Moving simplejson-1.7.1-py2.5.egg to /home/dma/dev/python
Adding simplejson 1.7.1 to easy-install.pth file
Installed /home/dma/dev/python/simplejson-1.7.1-py2.5.egg
Searching for FormEncode>=0.7
Best match: FormEncode 0.7.1
Downloading http://pylonshq.com/download/0.9.6.1/FormEncode-0.7.1.tar.gz
Processing FormEncode-0.7.1.tar.gz
Running FormEncode-0.7.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SA4wNQ/FormEncode-0.7.1/egg-dist-tmp-0R9DTo
warning: no files found matching '*.py' under directory '.'
warning: no files found matching '*.html' under directory 'docs'
no previously-included directories found matching '**/.svn'
zip_safe flag not set; analyzing archive contents...
formencode.fields: module references __file__
formencode.util.doctest24: module references __file__
formencode.util.doctest24: module MAY be using inspect.getsourcefile
Adding FormEncode 0.7.1 to easy-install.pth file
Installed /home/dma/dev/python/FormEncode-0.7.1-py2.5.egg
Searching for PasteScript>=1.3.6
Best match: PasteScript 1.3.6
Downloading http://pylonshq.com/download/0.9.6.1/PasteScript-1.3.6.tar.gz
Processing PasteScript-1.3.6.tar.gz
Running PasteScript-1.3.6/setup.py -q bdist_egg --dist-dir /tmp/easy_install-mCroaR/PasteScript-1.3.6/egg-dist-tmp-mK_7Km
Adding PasteScript 1.3.6 to easy-install.pth file
Installing paster script to /home/dma/dev/python
Installing paster script to /home/dma/dev/python
Installed /home/dma/dev/python/PasteScript-1.3.6-py2.5.egg
Searching for PasteDeploy>=1.3.1
Best match: PasteDeploy 1.3.1
Downloading http://pylonshq.com/download/0.9.6.1/PasteDeploy-1.3.1.tar.gz
Processing PasteDeploy-1.3.1.tar.gz
Running PasteDeploy-1.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-MdDVys/PasteDeploy-1.3.1/egg-dist-tmp-EaFU3J
warning: no files found matching 'docs/*.html'
warning: no previously-included files found matching 'docs/rebuild'
Adding PasteDeploy 1.3.1 to easy-install.pth file
Installed /home/dma/dev/python/PasteDeploy-1.3.1-py2.5.egg
Searching for Paste>=1.4
Best match: Paste 1.4.2
Downloading http://pylonshq.com/download/0.9.6.1/Paste-1.4.2.tar.gz
Processing Paste-1.4.2.tar.gz
Running Paste-1.4.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Xk89_1/Paste-1.4.2/egg-dist-tmp-fXyqxa
Adding Paste 1.4.2 to easy-install.pth file
Installed /home/dma/dev/python/Paste-1.4.2-py2.5.egg
Searching for Beaker>=0.7.5
Best match: Beaker 0.7.5
Downloading http://pylonshq.com/download/0.9.6.1/Beaker-0.7.5.tar.gz
Processing Beaker-0.7.5.tar.gz
Running Beaker-0.7.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-FnvTLX/Beaker-0.7.5/egg-dist-tmp-8ZVadL
Adding Beaker 0.7.5 to easy-install.pth file
Installed /home/dma/dev/python/Beaker-0.7.5-py2.5.egg
Searching for WebHelpers>=0.3.2
Best match: WebHelpers 0.3.2
Downloading http://pylonshq.com/download/0.9.6.1/WebHelpers-0.3.2.tar.gz
Processing WebHelpers-0.3.2.tar.gz
Running WebHelpers-0.3.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Dx13aE/WebHelpers-0.3.2/egg-dist-tmp-DCr1Al
Adding WebHelpers 0.3.2 to easy-install.pth file
Installed /home/dma/dev/python/WebHelpers-0.3.2-py2.5.egg
Searching for Routes>=1.7
Best match: Routes 1.7
Downloading http://pylonshq.com/download/0.9.6.1/Routes-1.7.tar.gz
Processing Routes-1.7.tar.gz
Running Routes-1.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-shjJ8m/Routes-1.7/egg-dist-tmp-cP0rM6
Adding Routes 1.7 to easy-install.pth file
Installed /home/dma/dev/python/Routes-1.7-py2.5.egg
Finished processing dependencies for Pylons
Now you can build a test application in order to check that Pylons installation has been successfull:
cd $HOME/dev/python
paster create --template=pylons test_app
The previous command will print in your terminal some logs like the following ones:
Selected and implied templates:
Pylons#pylons Pylons application template
Variables:
egg: test_app
package: test_app
project: test_app
Creating template pylons
Creating directory ./test_app
Recursing into +egg+.egg-info
Creating ./test_app/test_app.egg-info/
Copying paste_deploy_config.ini_tmpl_tmpl to ./test_app/test_app.egg-info/paste_deploy_config.ini_tmpl
Recursing into +package+
Creating ./test_app/test_app/
Copying __init__.py_tmpl to ./test_app/test_app/__init__.py
Recursing into config
Creating ./test_app/test_app/config/
Copying __init__.py_tmpl to ./test_app/test_app/config/__init__.py
Copying environment.py_tmpl to ./test_app/test_app/config/environment.py
Copying middleware.py_tmpl to ./test_app/test_app/config/middleware.py
Copying routing.py_tmpl to ./test_app/test_app/config/routing.py
Recursing into controllers
Creating ./test_app/test_app/controllers/
Copying __init__.py_tmpl to ./test_app/test_app/controllers/__init__.py
Copying error.py_tmpl to ./test_app/test_app/controllers/error.py
Copying template.py_tmpl to ./test_app/test_app/controllers/template.py
Recursing into lib
Creating ./test_app/test_app/lib/
Copying __init__.py_tmpl to ./test_app/test_app/lib/__init__.py
Copying app_globals.py_tmpl to ./test_app/test_app/lib/app_globals.py
Copying base.py_tmpl to ./test_app/test_app/lib/base.py
Copying helpers.py_tmpl to ./test_app/test_app/lib/helpers.py
Recursing into model
Creating ./test_app/test_app/model/
Copying __init__.py_tmpl to ./test_app/test_app/model/__init__.py
Recursing into public
Creating ./test_app/test_app/public/
Copying index.html_tmpl to ./test_app/test_app/public/index.html
Recursing into templates
Creating ./test_app/test_app/templates/
Recursing into tests
Creating ./test_app/test_app/tests/
Copying __init__.py_tmpl to ./test_app/test_app/tests/__init__.py
Recursing into functional
Creating ./test_app/test_app/tests/functional/
Copying __init__.py_tmpl to ./test_app/test_app/tests/functional/__init__.py
Copying test_models.py_tmpl to ./test_app/test_app/tests/test_models.py
Copying websetup.py_tmpl to ./test_app/test_app/websetup.py
Copying MANIFEST.in_tmpl to ./test_app/MANIFEST.in
Copying README.txt_tmpl to ./test_app/README.txt
Copying development.ini_tmpl to ./test_app/development.ini
Recursing into docs
Creating ./test_app/docs/
Copying index.txt_tmpl to ./test_app/docs/index.txt
Copying setup.cfg_tmpl to ./test_app/setup.cfg
Copying setup.py_tmpl to ./test_app/setup.py
Copying test.ini_tmpl to ./test_app/test.ini
Running /usr/bin/python setup.py egg_info
Adding Pylons to paster_plugins.txt
Adding WebHelpers to paster_plugins.txt
Launch paster web server in order to test the test_app application:
cd $HOME/dev/python/test_app
paster serve --reload development.ini
And last you can connect to your test_app application at the address http://127.0.0.1:5000/. Normally you will see a web page like the following one.