Package spammcan :: Module commands
[hide private]

Module commands

source code

This module contains functions to be called from console script entry points.

Classes [hide private]
  ConfigurationError
Functions [hide private]
 
_read_config(args)
Read deployment configuration file.
source code
 
bootstrap()
Example function for loading bootstrap data into the database
source code
 
start()
Start the CherryPy application server.
source code
Function Details [hide private]

_read_config(args)

source code 

Read deployment configuration file.

First looks on the command line for a desired config file, if it's not on the command line, then looks for 'setup.py' in the parent of the directory where this module is located.

If 'setup.py' is there, assumes that the application is started from the project directory and should run in development mode and so loads the configuration from a file called 'dev.cfg' in the current directory.

If 'setup.py' is not there, the project is probably installed and the code looks first for a file called 'prod.cfg' in the current directory and, if this isn't found either, for a default config file called 'default.cfg' packaged in the egg.

bootstrap()

source code 

Example function for loading bootstrap data into the database

Adapt this to your needs and also uncomment/add a line in your project's 'setup.py' file that says:

   'bootstrap-spammcan = spammcan.commands:bootstrap',