-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathREADME.txt
49 lines (34 loc) · 1.3 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Copyright 2008 Boomi, Inc.
All rights reserved.
Basic REST server for Google App Engine Applications using the builtin Datastore API.
For extended feature list, see http://code.google.com/p/appengine-rest-server/
========
For example client usage, see example.txt.
========
Getting Started
---------------
To use with an existing application:
import rest
# add a handler for "rest" calls
application = webapp.WSGIApplication([
<... existing webservice urls ...>
('/rest/.*', rest.Dispatcher)
], ...)
# configure the rest dispatcher to know what prefix to expect on request urls
rest.Dispatcher.base_url = "/rest"
# add all models from the current module, and/or...
rest.Dispatcher.add_models_from_module(__name__)
# add all models from some other module, and/or...
rest.Dispatcher.add_models_from_module(my_model_module)
# add specific models
rest.Dispatcher.add_models({
"foo": FooModel,
"bar": BarModel})
# add specific models (with given names) and restrict the supported methods
rest.Dispatcher.add_models({
"foo" : (FooModel, rest.READ_ONLY_MODEL_METHODS),
"bar" : (BarModel, ["GET_METADATA", "GET", "POST", "PUT"],
"cache" : (CacheModel, ["GET", "DELETE"] })
# use custom authentication/authorization
rest.Dispatcher.authenticator = MyAuthenticator()
rest.Dispatcher.authorizer = MyAuthorizer()