diff options
| author | Bert JW Regeer <xistence@0x58.com> | 2016-12-09 23:01:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-09 23:01:23 -0700 |
| commit | 98b7bc973092cb92395ecfc50c097793d00e6551 (patch) | |
| tree | 1975f4d89d0422aaabd09b9bf94ac0da93534f8d /docs | |
| parent | 2d45def603f038a8533eb9790640982012c0be30 (diff) | |
| parent | 1fde5f47b8b6208a25e951c6d3887cc73cc3696e (diff) | |
| download | pyramid-98b7bc973092cb92395ecfc50c097793d00e6551.tar.gz pyramid-98b7bc973092cb92395ecfc50c097793d00e6551.tar.bz2 pyramid-98b7bc973092cb92395ecfc50c097793d00e6551.zip | |
Merge pull request #2827 from mmerickel/pserve-watch-files
support a [pserve] config section with a list of files to watch
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/project.rst | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docs/narr/project.rst b/docs/narr/project.rst index 6c42881f4..77c637571 100644 --- a/docs/narr/project.rst +++ b/docs/narr/project.rst @@ -1065,3 +1065,25 @@ 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 may be absolute or relative to the configuration file. They may also +be an :term:`asset specification`. These paths are passed to ``hupper`` which +has some basic support for globbing. Acceptable glob patterns depend on the +version of Python being used. |
