mirror of
https://github.com/sprockets/sprockets.mixins.mediatype.git
synced 2024-12-27 20:24:39 +00:00
Subtly prefer add_transcoder in docs.
This commit is contained in:
parent
4a0ca5e390
commit
36244966e4
1 changed files with 2 additions and 4 deletions
|
@ -81,10 +81,8 @@ class ContentSettings:
|
|||
|
||||
def make_application():
|
||||
app = web.Application([('/', SomeHandler)])
|
||||
add_binary_content_type(app, 'application/msgpack',
|
||||
msgpack.packb, msgpack.unpackb)
|
||||
add_text_content_type(app, 'application/json', 'utf-8',
|
||||
json.dumps, json.loads)
|
||||
add_transcoder(app, transcoders.JSONTranscoder())
|
||||
add_transcoder(app, transcoders.MsgPackTranscoder())
|
||||
return app
|
||||
|
||||
Of course, that is quite tedious, so use the :class:`.ContentMixin`
|
||||
|
|
Loading…
Reference in a new issue