squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.61k stars 581 forks source link

Templating example? #38

Closed nicholastulach closed 7 years ago

nicholastulach commented 7 years ago

I apologize if this is too noobie of a question, but could someone write an example of how to use templating with Japronto? I'm used to Flask with built-in templating support and I don't know how to get started without it.

hashgupta commented 7 years ago

This would be possible if Japronto had a html option in the response object. Am I missing something? or is there a workaround to achieve html as response

squeaky-pl commented 7 years ago

@Superman132 you can do request.Response(text='<h5>Hello</h5>', mime_type='text/html')

squeaky-pl commented 7 years ago

This needs a recipe, meaning that somebody should write a piece of code that demonstrates how to use templating with Japronto. Fairly easy for experienced people and tremendously useful for newcomers.

I will accept a pull request.

fer1934 commented 7 years ago

f(e)r1934

El 07/02/2017 07:54, "Paweł Piotr Przeradowski" notifications@github.com escribió:

This needs a recipe, meaning that somebody should write a piece of code that demonstrates how to use templating with Japronto. Fairly easy for experienced people and tremendously useful for newcomers.

I will accept a pull request.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/squeaky-pl/japronto/issues/38#issuecomment-278042431, or mute the thread https://github.com/notifications/unsubscribe-auth/AYamvgYGwN6vkRtZoTpT2-iZwli8-RrHks5raJO8gaJpZM4L5hA6 .

jacobbridges commented 7 years ago

@squeaky-pl, I'll submit a PR for this within the next hour.

squeaky-pl commented 7 years ago

Many thanks @jacobbridges, @nicholastulach there is now an example in the examples folder.

nicholastulach commented 7 years ago

Thank you from me and all the other noobs!

On Feb 9, 2017, at 04:10, Paweł Piotr Przeradowski notifications@github.com wrote:

Many thanks @jacobbridges, @nicholastulach there is now an example in the examples folder.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.