-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a more complete example #62
Comments
One issue I faced for example is when having separate controller files, the paths would not be registered properly when creating the app because the file was loaded after the |
Hi @Sytten ! Thanks for the support. Ah, yes. Import order can be tricky with the registry pattern. The trick that I usually see is: Roughly: registry.py import flask_rebar
rebar = flask_rebar.Rebar()
registry = rebar.create_handler_registry() foo_handler.py import .registry
@registry.handles("/foo")
def get_foo():
... app.py from flask import Flask
from .registry import rebar
from .foo_handler import get_foo # noqa
def create_app(name):
app = Flask(name)
rebar.init_app(app)
return app But you are correct - this deserves its own example! Similar to #11 |
Thanks! Yes I figured it out eventually. If my team ends up choosing rebar, I will most certainly write a tutorial for it. |
I don't know much about https://github.com/justanr/marshmallow-annotations nor if it would work with flask-rebar out of the box, but flask-rebar does support pluggable marshmallow-to-swagger converters: https://flask-rebar.readthedocs.io/en/latest/quickstart/swagger_generation.html#custom-marshmallow-types |
Interesting, I will check that in due time. Probably need to create a custom authenticator for cognito too eventually, I could probably share it as an extension. Feel free to close the issue or keep it open, I might ramble more thoughts as we go in our project :D |
Thanks @Sytten - I'm taking over maintenance of Flask-rebar here; will leave this one open for now as I'm a big fan of rambled thoughts :D One of the things I'm doing is ensuring each open Issue has an assignee, for now will just assign this one to you (and will look forward to seeing what examples you build if you end up writing that tutorial!) |
Good to hear! We decided to go with rebar, so it's very likely that I will write something about it during the year. My next challenge is to integrate it with cognito authentication. |
Ok it has started, if you guys have time to proof read I would appreciate (english is not my native language :S): https://medium.com/@emilefugulin/creating-a-production-ready-python-rest-backend-with-flask-rebar-part-1-62f498d2f077 |
This looks really good so far! Will have to figure out the best place(s) to link to it from our docs as I'm sure others will find this helpful when Flask-Rebar becomes the de facto standard for Flask frameworks! :D |
OT but...
hope this helps spread the word! |
Good initiative @twosigmajab! |
OMG you guys are the best :) <3 |
Second part of the series is out: https://medium.com/@emilefugulin/creating-a-production-ready-python-rest-backend-with-flask-rebar-part-2-d6bcf4a5f0b2 |
@RookieRick @barakalon Let me know what you guys think of it :) |
Love it! I'm also happy to make comments on typos and other small things, if you care. I think Medium has a draft link? Or maybe thats only prior to publishing. |
I started reading it and got pulled off on something else yesterday but looked pretty good so far! I'll try to get back to it shortly. Thanks again for putting this together btw! |
@barakalon Feel free to send a list, I think the draft link is disabled since its published. |
Looks great - one suggestion: I'd go back and add a link to part 2 at the end of part 1 to make it easy for people to follow through the series. |
(Anyone want to send a quick PR to https://github.com/apisyouwonthate/openapi.tools to get Flask-Rebar listed on https://openapi.tools?) |
I just discovered
flask-rebar
and I think it could very well become the new standard for REST with flask. The documentation is very well made, but a more complete "real-life" example/template would help a lot to get started. I am creating one for my project that i could share, but I don't know all the best practices for the framework.Keep up the good work, cheers!
The text was updated successfully, but these errors were encountered: