Size: a a a

PiterPy Conf Сhat

2020 August 05

DS

David Shiko in PiterPy Conf Сhat
We recently heard about Django and Django Ninja, what do you think of it, can it be compared to fast api?
источник

DS

Doctor Strange in PiterPy Conf Сhat
Sebastián Ramírez
Good question! Yes, you can. In fact, you can also declare the response_model to use for that path operation and it will be documented in the automatic UI. And you can use Pydantic's orm_mode to declare the model to use for the response and even return an arbitrary object, like an ORM object (e.g. SQLAlchemy). But sure, yes, you can return BaseModel responses directly.
cool, thank you
источник

SR

Sebastián Ramírez in PiterPy Conf Сhat
David Shiko
We recently heard about Django and Django Ninja, what do you think of it, can it be compared to fast api?
I hadn't seen Django Ninja, that's interesting!

I see it was built by an active FastAPI user (vitalik), it uses Pydantic, and it says it was heavily inspired by FastAPI, so I would imagine it would probably work similarly 🙂
источник

DS

David Shiko in PiterPy Conf Сhat
Sebastián Ramírez
I hadn't seen Django Ninja, that's interesting!

I see it was built by an active FastAPI user (vitalik), it uses Pydantic, and it says it was heavily inspired by FastAPI, so I would imagine it would probably work similarly 🙂
Thanks
1 more question, would you advise a fast API for a newbie in the backend?
источник

SR

Sebastián Ramírez in PiterPy Conf Сhat
David Shiko
Thanks
1 more question, would you advise a fast API for a newbie in the backend?
Yes, I would recommend FastAPI for a newbie. The documentation is written as a tutorial that is understandable by a newbie and that explains everything step by step.

It will also teach the person to use some best practices by default, like data validation, data serialization, documentation, etc.

And also, because it's easier to code when everything has autocomplete and there are clear type check errors in the editor 🤷‍♂️ 😁
источник

DS

David Shiko in PiterPy Conf Сhat
Sebastián Ramírez
Yes, I would recommend FastAPI for a newbie. The documentation is written as a tutorial that is understandable by a newbie and that explains everything step by step.

It will also teach the person to use some best practices by default, like data validation, data serialization, documentation, etc.

And also, because it's easier to code when everything has autocomplete and there are clear type check errors in the editor 🤷‍♂️ 😁
Thanks one more
What is a main difference between django and fast api, why you started to develop it when django was already broadly in use ?
источник

DS

David Shiko in PiterPy Conf Сhat
It's just a little bit difficult to choose one of the 4 good libraries, especially when you hear about them from original developers :)
источник

SR

Sebastián Ramírez in PiterPy Conf Сhat
So, Django was made before APIs were so mainstream, to do APIs with Django, Tom Christie created Django Rest Framework. Then, after some time, he created a new framework with what he imagined would be the best way to build APIs, it was called APIStar. But then he had to deprecate it to focus on Starlette, that has one of the best performances available in Python.

I like to think FastAPI is a spiritual successor to APIStar, applying many of the learnings from it, that uses all the experience in building APIs, and using the best performance available (with Starlette).
источник

DS

David Shiko in PiterPy Conf Сhat
Sebastián Ramírez
So, Django was made before APIs were so mainstream, to do APIs with Django, Tom Christie created Django Rest Framework. Then, after some time, he created a new framework with what he imagined would be the best way to build APIs, it was called APIStar. But then he had to deprecate it to focus on Starlette, that has one of the best performances available in Python.

I like to think FastAPI is a spiritual successor to APIStar, applying many of the learnings from it, that uses all the experience in building APIs, and using the best performance available (with Starlette).
Very informative answer! 🙏
источник

IS

Irina Saribekova in PiterPy Conf Сhat
Вопросы Себастьяну
источник

YV

Yuliya Volkova in PiterPy Conf Сhat
and very informative talk ) thanks for it, also docs - really awesome
источник

YV

Yuliya Volkova in PiterPy Conf Сhat
one more question: did you have a chance to test or experience to compare how sided performance when you work from FastAPI with DB using SQLAlchemy (sync) or some async libraries like asyncpg or GinoORM  or maybe this question better address to @fantixking in the next talk :)
источник

IS

Irina Saribekova in PiterPy Conf Сhat
@tiangolo thank you for the talk 🔥
источник

YV

Yuliya Volkova in PiterPy Conf Сhat
thank you very much for very full and clear answers :)  @tiangolo awesome!
источник

IS

Irina Saribekova in PiterPy Conf Сhat
Сейчас в эфире @fantixking
С темой: Asynchronous Database Access with GINO

Во время доклада отмечайте спикера и задавайте вопросы в этом чате на английском, он вам ответит.

Вопросы на русском также можно писать, их модератор задаст в прямом эфире после доклада.

Если хотите задать вопрос лично в эфире, проверяйте свою камеру и гарнитуру и пишите мне в личку :)
источник

SR

Sebastián Ramírez in PiterPy Conf Сhat
Yuliya Volkova
thank you very much for very full and clear answers :)  @tiangolo awesome!
Thanks! 😁🚀
источник

IS

Irina Saribekova in PiterPy Conf Сhat
Доклад начался :)
источник

YV

Yuliya Volkova in PiterPy Conf Сhat
@fantixking did you look at https://github.com/encode/orm ? do you see any +- main difference with GinoORM?
источник

YV

Yuliya Volkova in PiterPy Conf Сhat
exclude docs )) Gino has best doc in all async orms that I saw
источник

FK

Fantix King in PiterPy Conf Сhat
Yeah, I really wanted to have its typesystem in GINO 🙂
источник