Author: Asko Soukka


        .. figure::

*sauna.reload: so that you can finish your Plone development today and relax in
sauna after calling it a day*

.. contents:: :local:


``sauna.reload`` is a developer tool which restarts Plone and reloads your changed source
code every time you save a file. The restart is optimized for speed
and happens much faster than a normal start up process.

* Edit your code
* Save
* Go to a browser and hit *Refresh* |->| your latest changes are active

It greatly simplifies your Plone development workflow and gives back the
agility of Python.

It works with any code.

``sauna.reload`` works on OSX and Linux with Plone 4.0 and 4.1. In theory
works on Windows, but no one has looked into that yet.

.. |->| unicode:: U+02794 .. thick rightwards arrow

User comments

"I don't want to use sauna.reload as I can knit a row while I restart ..."

"no more do I start a 5 minute cigarette every time Plone restarts for 30
seconds... ok wait, this kind of joy leads to poetry, I'm gonna stop here."


Here are brief installation instructions.


In order to take the advantage of ``sauna.reload``

* You know how to develop your own Plone add-ons and basics of buildout folder

* You know UNIX command line basics

* You know how to run buildout

* You are running Linux or OSX operating system

No knowledge for warming up sauna is needed in order to use this product.

Installing buildout configuration

The recommended installation configuration is to use ZEO server + 1 client for the development.
This method is valid for **Plone 4.1 and higher**. You can use ``sauna.reload``
without separate ZEO database server, using ``instance`` command,
`in this case you'll risk database corruption on restarts <>`_.

Below is the recommended approach how to enable ``sauna.reload`` for your
development environment. However, since this product is only for development
use the data loss should not be a big deal.

Add ``sauna.reload`` to your ``buildout.cfg`` file:


  eggs +=

  # This section is either client1 / instance depending
  # on your buildout
  zope-conf-additional = %import sauna.reload

OSX notes

If you are using vim (or macvim) on OSX, you must disable vim's writebackups
to allow WatchDog to see your modifications
(otherwise vim will technicallyj create a new file on each save and WatchDog
doesn't report the modification back to ``sauna.reload``).

So, Add the following to the end of your ``.vimrc``::

  set noswapfile
  set nobackup
  set nowritebackup

Similar issues have been reported with some other OSX-editors.
Tips and fixes for these are welcome.

Ubuntu / Debian / Linux notes

You might need to raise your open files *ulimit* if you are operating on the
large set of files, both hard and soft limit.


104000 is a known good value.

If your *ulimit* is too low you'll get very misleading *OSError: No space left
on device*.

Usage: start Plone in reload enabled manner

To start Plone with reload functionality you need
to give special environment variable ``RELOAD_PATH``
for your client1 command::

  # Start database server
  bin/zeoserver start

  # Start Plone with reload enabled
  RELOAD_PATH=src bin/client1 fg

Or if you want to optimize load speed you can directly specify only some of
your development products::

  RELOAD_PATH=src/my.product:src/my.another.product bin/client1 fg

.. warning:: If other products depend on your product, e.g CMFPlone
   dependencies, sauna.reload does not kick in early enough and the reload does
   not work.

When reload is active you should see something like this in your console