Skip to content

Commit

Permalink
Update - more instructions for newbies
Browse files Browse the repository at this point in the history
  • Loading branch information
Geir Magnusson Jr committed Mar 17, 2009
1 parent 755342e commit 4f8872c
Showing 1 changed file with 60 additions and 4 deletions.
64 changes: 60 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,28 @@ group <http://groups.google.com/group/mongodb-user>`_.
Usage
=====

In order to use the adapter, you must patch the AppEngine source
distribution, which can be found `here <http://code.google.com/p/googleappengine>`_ and checked out
by doing::
Follow the following steps to get Google AppEngine working with MongoDB.

$ svn checkout http://googleappengine.googlecode.com/svn/trunk/ googleappengine-read-only
Get the Google AppEngine Code
-----------------------------

In order to use the adapter, you must patch the AppEngine source distribution, which can
be found `here <http://code.google.com/p/googleappengine>`_ and checked out via::

$ svn checkout http://googleappengine.googlecode.com/svn/trunk/ googleappengine-read-only

Patches are found in the *gae_patches/* directory and are stored by
svn revision number. To find the revision number of the respository
that you checked out, go into the root of the repository and type::

$ svn info

Be sure that you meet all the pre-requisites listed in the READM in the AE
directory, and also be sure that you have MongoDB installed and running.

Patch the AppEngine code
------------------------

This adapter has been tested against revision 41 from Google
AppEngine's svn repository. The following patch (generated by `svn
diff`) shows how to modify the AppEngine code in order to use MongoDB::
Expand Down Expand Up @@ -85,6 +95,52 @@ you should see output similar to::

If you see no error messages, your patching was successful.

Set the MongoDB Connector Directory
-----------------------------------

In the AE distribution, we patched *dev_appserver.py* in the previous step, and now we
need to edit it by hand. Open the file in your favorite editor, and look for the line

"PATH/TO/MONGO-APPENGINE-CONNECTOR/DIRECTORY"

and change it to the appropriate value. Remember to keep the double quotes.

Install PyMongo, the Python Driver for MongoDB
----------------------------------------------

If you've already installed the MongoDB python driver - PyMongo - you can skip this step.

To install PyMongo :

$ easy_install pymongo

Run the Tests
-------------

Once AE is patched, pymongo is installed, and MongoDB is up and running, you can test
the installation by running the adapter's unit tests.

To do so, simply start AE via the SDKs start script *dev_appserver.py* with the full path to the
test/test_site directory in the adapter distribution. So, starting in the root of the
AE SDK :

$ ./dev_appserver.py /my/path/to/mongodb-appengine-connector/test/test_site

Then, if you direct your browser to *http://localhost:808* you should see a single test
page that begins with::

Datastore API
Test a simple db example...
Test that ids get incremented properly between sessions...
Slightly less simple db test...
Test db exceptions...
Test a delete...
Test a delete on an unsaved object...
...

and as long as you don't see the word 'FAIL', all tests pass and you are ready to go.


Other Notes
===========

Expand Down

0 comments on commit 4f8872c

Please sign in to comment.