File: reload.rst

package info (click to toggle)
python-pecan 1.5.1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,296 kB
  • sloc: python: 10,389; makefile: 131; sh: 17
file content (28 lines) | stat: -rw-r--r-- 865 bytes parent folder | download | duplicates (7)
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
:orphan:

#reload
Reloading Automatically as Files Change
---------------------------------------

Pausing to restart your development server as you work can be interruptive, so
:command:`pecan serve` provides a ``--reload`` flag to make life easier.

To provide this functionality, Pecan makes use of the Python
`watchdog <https://pypi.python.org/pypi/watchdog>`_ library.  You'll need to
install it for development use before continuing::

    $ pip install watchdog
    Downloading/unpacking watchdog
    ...
    Successfully installed watchdog

::

    $ pecan serve --reload config.py
    Monitoring for changes...
    Starting server in PID 000.
    serving on 0.0.0.0:8080, view at http://127.0.0.1:8080

As you work, Pecan will listen for any file or directory modification
events in your project and silently restart your server process in the
background.