Clever Harold Command Reference
-------------------------------

The framework extends the ``paster`` script with additional commands.
On this page, we've included the help for each command instead of
actual documentation.  


Recreate data models from the definitions in your project
configuration file::

    $ paster recreate-models --help
    usage: /usr/bin/paster recreate-models [options]
    Create or recreate database model

    This command creates or recreates the model specified in the configuration file.

    options:
      -h, --help            show this help message and exit
      -v, --verbose         
      -q, --quiet           
      -d, --drop            Drop tables before create
      -i, --ignore          Ignore database exceptions
      -f FILE, --file=FILE  use config FILE (local default is project.ini)
      -s SECTION, --section=SECTION
			    Use the models named by SECTION (default
			    filter:data_provider_dev)
      -l, --list            print available database sections and exit
      -n, --no-populate     Skip populating models.


Load a python or ipython shell with your data models imported and
connected::

    $ paster shell --help
    usage: /usr/bin/paster shell [options]
    Run interactive interpreter with models

    Run interactive interpreter preloaded with database models and connections.

    options:
      -h, --help            show this help message and exit
      -v, --verbose         
      -q, --quiet           
      -f FILE, --file=FILE  use config FILE (local default is project.ini)
      -s SECTION, --section=SECTION
			    Use the models named by SECTION (default
			    filter:data_provider_dev)
      -l, --list            print available database sections and exit


Create a new project::

    $ paster init-harold --help
    usage: /usr/bin/paster init-harold [options] NAME
    Create a new Clever Harold project

    options:
      -h, --help            show this help message and exit
      -v, --verbose         

To run an application, use the ``paster harold`` command::

    $ paster harold --help
    usage: /usr/bin/paster harold [options] CONFIG_FILE [start|stop|restart|status]
    Serve the described application

    This command serves a web application that uses a paste.deploy configuration file for
    the server and application.    If start/stop/restart is given, then --daemon is
    implied, and it will start (normal operation), stop (--stop-daemon), or do both.

    options:
      -h, --help            show this help message and exit
      -v, --verbose         
      -q, --quiet           
      -n NAME, --app-name=NAME
			    Load the named application (default main)
      -s SERVER_TYPE, --server=SERVER_TYPE
			    Use the named server.
      --server-name=SECTION_NAME
			    Use the named server as defined in the configuration file
			    (default: main)
      --daemon              Run in daemon (background) mode
      --pid-file=FILENAME   Save PID to file (default to paster.pid if running in daemon
			    mode)
      --log-file=LOG_FILE   Save output to the given log file (redirects stdout)
      --reload              Use auto-restart file monitor
      --reload-interval=RELOAD_INTERVAL
			    Seconds between checking files (low number can cause
			    significant CPU usage)
      --status              Show the status of the (presumably daemonized) server
      --user=USERNAME       Set the user (usually only possible when run as root)
      --group=GROUP         Set the group (usually only possible when run as root)
      --stop-daemon         Stop a daemonized server (given a PID file, or default
			    paster.pid file)




Further Reading
---------------

- `Paste Script Documentation`_



.. _Paste Script Documentation:  http://pythonpaste.org/script/
