| 1 |
:orphan: |
| 2 |
|
| 3 |
#reload |
| 4 |
Reloading Automatically as Files Change |
| 5 |
--------------------------------------- |
| 6 |
|
| 7 |
Pausing to restart your development server as you work can be interruptive, so |
| 8 |
:command:`pecan serve` provides a ``--reload`` flag to make life easier. |
| 9 |
|
| 10 |
To provide this functionality, Pecan makes use of the Python |
| 11 |
`watchdog <https://pypi.python.org/pypi/watchdog>`_ library. You'll need to |
| 12 |
install it for development use before continuing:: |
| 13 |
|
| 14 |
$ pip install watchdog |
| 15 |
Downloading/unpacking watchdog |
| 16 |
... |
| 17 |
Successfully installed watchdog |
| 18 |
|
| 19 |
:: |
| 20 |
|
| 21 |
$ pecan serve --reload config.py |
| 22 |
Monitoring for changes... |
| 23 |
Starting server in PID 000. |
| 24 |
serving on 0.0.0.0:8080, view at http://127.0.0.1:8080 |
| 25 |
|
| 26 |
As you work, Pecan will listen for any file or directory modification |
| 27 |
events in your project and silently restart your server process in the |
| 28 |
background. |