python bottle installation tutorial

Course

This tutorial will introduce you to the Bottle web conceptual and functional framework, covering basic and advanced topics.

You can read through from beginning to end, or at a later time to use, as a reference manual. At the same time, you may be automatically generated API interest Reference Manual. It covers more details, but no details described in this tutorial. We will encounter many problems, the page can be found in the reply list or FAQ. If you need any help, you can join our mailing list, or visit our IRC channel.

Installation
Bottle is not based on any extension of the library. Just download bottle.py file to your project directory can use it.

wget http://bottlepy.org/bottle.py

You can get the latest development version contains all the functions by this command. If you want to use in a production environment , it would have to select the stable version. These versions are included in PyPI can by pip, easy_install or your other package manager to install.

$ sudo pip install bottle              # recommended
$ sudo easy_install bottle             # alternative without pip
$ sudo apt-get install python-bottle   # works for debian, ubuntu

No matter which way through the installation, you need Python 2.5 update or release (including 3.X) to run the bottle applications. If you do not have permission to install system-level software packages or just do not want to install, you can create a

$ virtualenv develop              # Create virtual environment
$ source develop/bin/activate     # Change default python to virtual one
(develop)$ pip install -U bottle  # Install bottle to virtual environment

If your system is not installed virtualenv , execute the following command to install:

$ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python virtualenv.py develop    # Create virtual environment
$ source develop/bin/activate     # Change default python to virtual one
(develop)$ pip install -U bottle  # Install bottle to virtual environment

Reference: Bottle Chinese tutorial :( a) Installation

Reproduced in: https: //www.jianshu.com/p/6045083fcad2

Guess you like

Origin blog.csdn.net/weixin_34192993/article/details/91092637