A skeleton Flask, CherryPy, MongoDB app.
- Flask,
easy_install flask
- CherryPy WSGI Server,
easy_install cherrypy
(for production)
- Run the install script
python install.py
and choose the port the app will run at (default is 5000) - Configure MongoDB database settings in
config.py
(optional)
The app can be run through the Werkzeug WSGI server that comes with Flask. To run it, execute python flask_app.py
.
Provided you have set DEBUG = True
in your config.py
file, this option will give you an interactive debugger and your app will be reloaded if changes to source files are detected.
- Run
./start_server.sh
. This will launchcherryd
with settings coming fromcherrypy.conf
that uses an 'in-between' scriptcreate_flask_app.py
to attach the Flask Object to the server - A file,
cherrypy.pid
will be created that has the id of the process running - Calling
./stop_server.sh
will read the .pid file and kill the process waiting for child threads to terminate