Building a minimalist web2py

Some times we need to deploy web2py in a server with very small memory footprint. In this case we want to strip down web2py to its bare minimum.

An easy way to do it is the following:

  • On a production machine, install the full web2py from source
  • From inside the main web2py folder run
  1. python scripts/make_min_web2py.py /path/to/minweb2py
  • Now copy under “/path/to/minweb2py/applications” the applications you want to deploy
  • Deploy “/path/to/minweb2py” to the small footprint server

The script “make_min_web2py.py” builds a minimalist web2py distribution that does not include:

  • admin
  • examples
  • welcome
  • scripts
  • rarely used contrib modules

It does include a “welcome” app consisting of a single file to allow testing deployment. Look into this script. At the top it contains a detailed list of what is included and what is ignored. You can easily modify it and tailor to your needs.