Flask example project. #40
Comments
Hi, thank you for your interest in the dry-python project! We will eventually provide tutorials for flask, aiohttp and pyramid projects. Flask tutorial is blocked by these issues: Because at this point we have limited Flask support in our integrations, we won't include it to the tutorial right now. At this point you can use Flask this way:
If you have any questions, feel free to ask them in our Gitter or here! Have a good day 🎉 Best regards, |
Hi @proofit404 , Thanks for the quick response. We are starting a new project using dry-python (stories, dependencies and attrs) with flask but django ORM (like in this gist: https://gist.github.com/seanbehan/168a277a5a23086e76000a59e54fb3d5). We made the choice to use django ORM as we already have related project written in django and all the team is familliar with it. We do not understand yet all the benefits of using dependencies and attrs but stories seems very promising for us. This is a very new projet so the structure is not very fixed yet. Regards, |
I guess it's very reasonable to use Django ORM in your conditions. I also prefer Django migrations over alembic. It's easy to use any routing/view layer together with dry-python because it doesn't know anything about database under the hood. Everything view layer knows about is You will appreciate the power of the For example, let's take a look at this step implementation: https://github.com/dry-python/tutorials/blob/1c2b9547ccf60551a42c2e7160cbaab8960f4144/django/example/services/buy_subscription.py#L60-L65 The actual business logic here "notify the user at the end of this scenario" does not know how you're going to do it. Maybe it will Twilio SMS gateway, maybe it will be Django Channels WebSocket, maybe it will be Google cloud messaging push notification to the user smartphone. Business logic doesn't care about this. When we would see it? In an actual use case of this story. This way you view layer decide in what way this actual view can notify the user. You can even have many configurations at different API endpoints using the same story object.
Btw, we have a pro support plan for the whole family of dry-python libraries. So if you met urgent bug, lack some critical feature or need on-premise training don't hesitate to contact us at https://drylabs.io/ P.S. Since you're using Django maybe you'll be interested in the mappers project as well. Best regards, |
I think we are now ready to test it in depth. Anyway, thanks a lot for your time. Benoit |
Hi Artem, We will produce a tutorial project including dependencies and stories with connexion (https://github.com/zalando/connexion) and django ORM for a presentation we might give in september. If you want it could be a good start for a flask tutorial with django ORM. Regards, |
Hi Benoit, It would be awesome! 100% awesome! And it is 100% welcome! It would be helpful if it'll be not one huge pull request, but a series of small sequential pull requests. And we can start this iteration as soon as possible. By the way, what kind of presentation you suppose to give in September? How could I help? Regards, Artem. |
As this is code we produced durring our working hours with my colleague, we will add it in a separate repository in a new organisation we will create for the occasion. But, as the code should be released with MIT or BSD license we should be able to use it to build a dry-python example project from it. I will try to help in my spare time to do this. The presentation is about code quality and best practices to build clean microservices in python. |
@M0dM Could you provide some link for Grenoble Python Meetup in September? We would like to share it in dry-python tweeter and site. |
Hi Artem,
The date is not fixed yet.
The person in charge is on hollidays.
I will let you know as soon as I have a date.
|
Hi @proofit404, The date is set for the 12 of December finally. I will let you know as soon as I have some material. |
Cool! Thanks for the update. |
Hi @proofit404, We did it. Django ORM + Connexion (Api first with flask) + stories & dependencies + other tools |
Thank you 🎉 🕺 🎉 https://twitter.com/dry_py/status/1207658468569702400 Let me know if there is a video available for it! |
No, we don't have any video. |
A separate repo with a complete flask project would be an ideal solution. The same is try for aiohttp, pyramid, fastapi, etc. |
Hi,
I would love to have a flask example project like the one you've done for django.
M0dM
The text was updated successfully, but these errors were encountered: