⌘BABAKOV.NET Let's code!
100% [light] [ru]

Python Bottle Guide (Translation) Part 1 - Installation

This guide will introduce you to the concepts and features of the Bottle framework. This guide can be read from start to finish as a tutorial for familiarization. It can also be used as a reference guide for familiarization with the features of the Bottle framework.
This guide is an adapted translation of information from the resource BOTTLEPY.ORG dated 20.04.2017.

This guide contains some of my comments and additions in places. Therefore, it is not a direct translation, but I hope it is of sufficient quality.

So, let's get started.


Bottle does not require any additional libraries. You can simply download bottle.py to the folder with your project and start writing code:

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


By this method, you will get the latest version of the Bottle framework, including all the latest improvements.

If you prefer to work in a more stable environment, you should download the stable release.
The stable release can be installed in three ways:

$ sudo pip install bottle              # Рекомендованный способ
$ sudo pip3 install bottle             # Рекомендованный способ для Pyton 3 версии
$ sudo easy_install bottle             # альтернативный способ без использования pip
$ sudo apt-get install python-bottle   # этот способ работает для систем на базе debian, ubuntu, ...



In any case, you will need Python 2.7 or later (including 3.2+) to run applications written in Bottle.

If you do not have the right to install packages or do not want to, you can try to run in a virtual environment (virtualenv):

$ virtualenv develop              # Создает виртуальное окружение
$ source develop/bin/activate     # Меняем Python по умолчанию на виртуальный
(develop)$ pip install -U bottle  # Устанавливаем Bottle в виртуальное окружение



Or, if virtualenv is not installed on your system:

$ wget https://raw.github.com/pypa/virtualenv/master/virtualenv.py
$ python virtualenv.py develop    # Создаем виртуальное окружение
$ source develop/bin/activate     # Меняем Python по умолчанию на виртуальный
(develop)$ pip install -U bottle  # Устанавливаем Bottle в виртуальное окружение

Comments (0)

No comments yet.

Leave a comment
Comment
Images (up to 5 MB)
Your comment will appear after moderation.