diff --git a/README.asciidoc b/README.asciidoc index 17a68e7..ed4104a 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -55,7 +55,7 @@ To run the application install the <> then: git clone https://github.com/srackham/bottle-mongodb-example.git cd bottle-mongodb-example - python bottle-mongodb-example.py + python main.py The application creates and displays a paged list of user created messages which are stored in a MongoDB database along with @@ -74,6 +74,14 @@ the database, tables or schema -- it all happens automatically. sudo easy_install pymongo +- mongoengine, the Python Object-Document-Mapper for working with MongoDB + + pip install mongoengine + +- mako, the Python template library + + pip install mako + - The Bottle web-framework: git clone https://github.com/defnull/bottle.git diff --git a/controllers.py b/controllers.py index 47f8507..5478a04 100644 --- a/controllers.py +++ b/controllers.py @@ -5,7 +5,10 @@ from bottle import request, response, get, post from bottle import static_file, redirect, HTTPResponse from bottle import mako_view as view -from PIL import Image +try: + from PIL import Image +except ImportError: + import Image from pymongo.objectid import ObjectId from models import Message