Kickstart your API Model, Auth and Mock beehives. Just install it with pip and you are good to go.
bzz understands the models you've mapped and creates restful routes that you can add to your tornado app.
Learn more ›from tornado.web import Application
from tornado.ioloop import IOLoop
from mongoengine import *
import bzz
# just create your own documents
class User(Document):
name = StringField()
routes = bzz.ModelHive \
.routes_for(User)
app = Application(routes)
app.listen(8888)
IOLoop.instance().start()Specially when working with distributed teams, it's very valuable to provide an API contract early in the process. bzz provides easy mocking of interactions to enable clients of your API to work, while you focus on creating the actual API.
Learn more ›from tornado.web import Application
from tornado.ioloop import IOLoop
import bzz
# status 200 is assumed
get_opt = {
'body': '{}'
}
post_opt = {
'body': 'OK'
'cookies': {
'super': 'cow'
},
'status': 203
}
mocked_routes = bzz.MockHive.routes_for([
('GET', '/sample', get_opt),
('POST', '/sample', post_opt),
])
app = Application(mocked_routes)
app.listen(8888)
IOLoop.instance().start()Why keep doing authentication over and over again? bzz automates authentication against a myriad of OAUTH sources for your API using JWT.
Learn more ›from tornado.web import Application
from tornado.ioloop import IOLoop
import bzz
providers = [
bzz.GoogleProvider,
bzz.FacebookProvider,
bzz.GithubProvider,
# MyCustomProvider
]
routes = bzz.AuthHive \
.routes_for(providers)
app = Application(routes)
bzz.AuthHive.configure(app)
app.listen(8888)
IOLoop.instance().start()