Skip to main content

A web2py recipe for buildout.

Project description

A buildout to develop the web2pyrecipe.

It should download the lastest version of web2py, install an user defined app
and create a script to run it.

- Code repository: http://github.com/douglascamata/web2pyrecipe...
- Questions and comments to d.camata@gmail.com
- Report bugs at http://github.com/douglascamata/web2pyrecipe/issues..


Detailed Documentation
**********************

Supported options
=================

appdir
The directory where the compressed web2py application should be ...

default
The default app of the web2py server ...

password
The password for web2py adminsitrative app ...

Testing now::

>>> write('buildout.cfg',
... """
... [buildout]
... parts = test1
...
... [test1]
... recipe = web2pyrecipe
... password = 123
... pidfile = pid.txt
... appdir = %(dir)s
... default = web2py.app.chat
... option2 = %(bar)s
... """ % { 'dir' : 'web2pyapps', 'bar' : 'value2'})

>>> mkdir('web2pyapps')
...

Downloading example app::

>>> system('wget http://www.web2py.com/appliances/default/download/app.source.aa6d3615911c89b6.7765623270792e6170702e636861742e773270.w2p -O web2pyapps/web2py.app.chat.w2p -q')
''

Running the buildout gives us::

>>> print 'start', system(buildout)
start...
Installing test1.
Unused options for test1: 'option2'.
<BLANKLINE>

Checking the root directory structure::

>>> ls('.')
- .installed.cfg
d bin
- buildout.cfg
d develop-eggs
d eggs
d parts
d web2py
d web2pyapps

Checking the test app for w2p::

>>> ls('web2pyapps')
- web2py.app.chat.w2p

Checking if web2py is extracted correctly::

>>> ls('web2py')
- ABOUT
- LICENSE
- Makefile
- NEWINSTALL
- README
- VERSION
- __init__.py
- anyserver.py
- app.example.yaml
- appengine_config.py
d applications
- cgihandler.py
- epydoc.conf
- epydoc.css
- fcgihandler.py
- gaehandler.py
d gluon
- isapiwsgihandler.py
- logging.example.conf
- modpythonhandler.py
- options_std.py
- queue.example.yaml
- router.example.py
- routes.example.py
- routes.py
- scgihandler.py
d scripts
- setup.py
- setup_app.py
- setup_exe.py
- setup_exe_2.6.py
d site-packages
- splashlogo.gif
- web2py.py
- wsgihandler.py

Checking if the test app is correctly extracted at web2py's application directory::

>>> ls(join('web2py','applications'))
- __init__.py
d admin
d examples
d web2py_app_chat
d welcome

>>> cat(join('web2py','routes.py'))
default_application = 'web2py_app_chat'
default_controller = 'default'
default_function = 'index'

Checking if the script for running the web2py server is created on 'bin' directory::

>>> ls('bin')
- buildout
- web2py

So, let's check the content of 'web2py' script::

>>> cat(join('bin','web2py'))
#!/bin/bash
PYTHON=python
<BLANKLINE>
start() {
${PYTHON} web2py/web2py.py -a 123 -d pid.txt &
}
<BLANKLINE>
stop() {
kill `cat web2py/pid.txt`
}
<BLANKLINE>
case "$1" in
start)
start;;
stop)
stop;;
restart)
start
stop;;
*)
echo "Usage: web2py {start|stop|restart}"
exit 1;;
esac
exit


Contributors
************

"Douglas Camata", Author


Change history
**************

1.0.1 (2011-11-10)
----------------

- Lots of refactoring to a more pythonic and less
system-depedent code


1.0.0 (2010-09-30)
----------------

- Initial release

Download
********

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

web2pyrecipe-1.0.1.tar.gz (121.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page