Configure turbogears 2.1 in centos 5 Linux

Source: Internet
Author: User
Tags virtual environment virtualenv
Document directory
  • 1. Prepare the environment
  • 2. Set the virtual environment and install tg21

 

1. Prepare the environment

 

In centos 5.x Linux, Python 2.4 has been installed by default. Therefore, we will install turbogears 2.1 on this basis.

At the time of writing this article, the latest tg21 version is RC1. We will install it on this basis.

Install easy_install first. We recommend that you use the latest version above pypi.python.org. Do not use yum for installation. The built-in centos version is relatively low.

Download easy_install 0.6c11 with wget:

$ Wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg#md5=bd639f9b0eac4c42497034dec2ec0c2b

Then run sh to execute the downloaded. Egg file:

$ Sh./setuptools-0.6c11-py2.4.egg

This completes the installation of setuptools.

Next, we will install a virtualenv software. This software can construct a virtual Python environment and install the third-party software packages downloaded during turbogears installation to this virtual environment without affecting the system environment. You can also create multiple virtual environments and try different third-party software packages in different environments.

Install virtualenv directly with easy_install.

$ Easy_install virtualenv

Now, the environment required for installation is ready.

2. Set the virtual environment and install tg21

Use virtualenv to create a virtual environment, and then install turbogears 2.1 in the virtual environment

$ Virtualenv -- no-site-packages tg21env
$ CD tg21env/
$ Source bin/activate
(Tg21env) $ easy_install hashlib pysqlite UUID functools
(Tg21env) $ easy_install-u beaker
(Tg21env) $ easy_install-I http://www.turbogears.org/2.1/downloads/current/index TG. devtools
(Tg21env) $ Paster Quickstart example
(Tg21env) $ CD example/
(Tg21env) $ Python setup. py develop
(Tg21env) $ nosetests
(Tg21env) $ Paster setup-app development. ini
(Tg21env) $ Paster serve development. ini

Open your browser and enter http: // 127.0.0.1: 8080 in the address bar.

 

Installed successfully!

If you want to access this test server from another computer, modify the development. ini in the example directory and set the host value to 0.0.0.0 in [server: Main.

If you want to exit from the virtual environment, type:

(Tg21env) $ deactivate

You can.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.