diff options
| author | Michael Merickel <michael@merickel.org> | 2016-11-21 00:14:26 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-11-21 00:57:57 -0600 |
| commit | 3f130937bcce073e9933e28c332e59c559025e07 (patch) | |
| tree | 6842711ea8a9b50c4a68500745795750231d373a /docs | |
| parent | 52bfe0a8f2f6d305f0e3d8cead290427fd71e926 (diff) | |
| download | pyramid-3f130937bcce073e9933e28c332e59c559025e07.tar.gz pyramid-3f130937bcce073e9933e28c332e59c559025e07.tar.bz2 pyramid-3f130937bcce073e9933e28c332e59c559025e07.zip | |
support a [pserve] config section with a list of files to watch
fixes #2732
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/project.rst | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 6c42881f4..b4ad6948e 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -1065,3 +1065,23 @@ hard drive, you should install the `watchdog <http://pythonhosted.org/watchdog/>` package in development. ``hupper`` will automatically use ``watchdog`` to more efficiently poll the filesystem. + +Monitoring Custom Files +~~~~~~~~~~~~~~~~~~~~~~~ + +By default, ``pserve --reload`` will monitor all imported Python code +(everything in ``sys.modules``) as well as the config file passed to +``pserve`` (e.g. ``development.ini``). You can instruct ``pserve`` to watch +other files for changes as well by defining a ``[pserve]`` section in your +configuration file. For example, let's say your application loads the +``favicon.ico`` file at startup and stores it in memory to efficiently +serve it many times. When you change it you want ``pserve`` to restart: + +.. code-block:: ini + + [pserve] + watch_files = + myapp/static/favicon.ico + +Paths are relative to the configuration file and are passed to ``hupper`` +to watch. Currently it does not support globs but this may change. |
