A skeleton Flask, CherryPy, MongoDB app.
- Flask
- CherryPy WSGI Server (for production)
Make sure these are installed:
-
Flask
easy_install flask
-
CherryPy
easy_install cherrypy
-
Run the install script
python install.py
and choose the port the app will run at -
Configure MongoDB database settings in
config.py
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