/usr/share/doc/python-cherrypy3-doc/html/_sources/install.rst.txt is in python-cherrypy3-doc 8.9.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | Installation
------------
CherryPy is a pure Python library. This has various consequences:
- It can run anywhere Python runs
- It does not require a C compiler
- It can run on various implementations of the Python language: `CPython <http://python.org/>`_,
`IronPython <http://ironpython.net/>`_, `Jython <http://www.jython.org/>`_ and `PyPy <http://pypy.org/>`_
.. contents::
:depth: 4
Requirements
############
CherryPy does not have any mandatory requirements. However certain features it comes with
will require you install certain packages. To simplify installing additional
dependencies CherryPy enables you to specify extras in your requirements (e.g.
``cherrypy[json,routes_dispatcher,ssl]``):
- doc -- for documentation related stuff
- json -- for custom `JSON processing library <https://github.com/simplejson/simplejson>`_
- routes_dispatcher -- `routes <http://routes.readthedocs.org/en/latest/>`_ for declarative URL mapping dispatcher
- ssl -- for `OpenSSL bindings <https://github.com/pyca/pyopenssl>`_, useful in Python environments not having the builtin :mod:`ssl` module
- testing
- memcached_session -- enables `memcached <https://github.com/linsomniac/python-memcached>`_ backend session
- xcgi
Supported python version
########################
CherryPy supports Python 2.7 through to 3.5.
Installing
##########
CherryPy can be easily installed via common Python package managers such as setuptools or pip.
.. code-block:: bash
$ easy_install cherrypy
.. code-block:: bash
$ pip install cherrypy
You may also get the latest CherryPy version by grabbing the source code from Github:
.. code-block:: bash
$ git clone https://github.com/cherrypy/cherrypy
$ cd cherrypy
$ python setup.py install
Test your installation
^^^^^^^^^^^^^^^^^^^^^^
CherryPy comes with a set of simple tutorials that can be executed
once you have deployed the package.
.. code-block:: bash
$ python -m cherrypy.tutorial.tut01_helloworld
Point your browser at http://127.0.0.1:8080 and enjoy the magic.
Once started the above command shows the following logs:
.. code-block:: bash
[15/Feb/2014:21:51:22] ENGINE Listening for SIGHUP.
[15/Feb/2014:21:51:22] ENGINE Listening for SIGTERM.
[15/Feb/2014:21:51:22] ENGINE Listening for SIGUSR1.
[15/Feb/2014:21:51:22] ENGINE Bus STARTING
[15/Feb/2014:21:51:22] ENGINE Started monitor thread 'Autoreloader'.
[15/Feb/2014:21:51:22] ENGINE Started monitor thread '_TimeoutMonitor'.
[15/Feb/2014:21:51:22] ENGINE Serving on http://127.0.0.1:8080
[15/Feb/2014:21:51:23] ENGINE Bus STARTED
We will explain what all those lines mean later on, but suffice
to know that once you see the last two lines, your server
is listening and ready to receive requests.
Run it
######
During development, the easiest path is to run your application as
follow:
.. code-block:: bash
$ python myapp.py
As long as `myapp.py` defines a `"__main__"` section, it will
run just fine.
cherryd
^^^^^^^
Another way to run the application is through the ``cherryd`` script
which is installed along side CherryPy.
.. note::
This utility command will not concern you if you embed your
application with another framework.
Command-Line Options
~~~~~~~~~~~~~~~~~~~~
.. program:: cherryd
.. cmdoption:: -c, --config
Specify config file(s)
.. cmdoption:: -d
Run the server as a daemon
.. cmdoption:: -e, --environment
Apply the given config environment (defaults to None)
.. index:: FastCGI
.. cmdoption:: -f
Start a :ref:`FastCGI <fastcgi>` server instead of the default HTTP server
.. index:: SCGI
.. cmdoption:: -s
Start a SCGI server instead of the default HTTP server
.. cmdoption:: -i, --import
Specify modules to import
.. index:: PID file
.. cmdoption:: -p, --pidfile
Store the process id in the given file (defaults to None)
.. cmdoption:: -P, --Path
Add the given paths to sys.path
|