This looks like a really neat project! The examples certainly feel less “script-like” than streamlit. One thing I find disappointing though, is that this framework is built on top of FastAPI. I feel it’s a bad idea to build on top of what’s basically a one-man project. No matter how popular that project is.
Thanks! we found script-like frameworks like Streamlit are nice for small apps, but hard to reason about for larger apps. We went with a declarative approach more similar to React. FastAPI has been working well for us, but we're not strongly coupled to it - in the future it would be easy to swap it out if needed.
Designing a Pure Python Web Framework
21–30 of 59 posts
Re: Designing a Pure Python Web Framework
#22Re: Designing a Pure Python Web Framework
#23Earlier quoted context omitted.
Thanks! we found script-like frameworks like Streamlit are nice for small apps, but hard to reason about for larger apps. We went with a declarative approach more similar to React. FastAPI has been working well for us, but we're not strongly coupled to it - in the future it would be easy to swap it out if needed.
Stay with FastAPI at least for now. Devs love it.
Re: Designing a Pure Python Web Framework
#24I have used this to build an internal tool, and that was quite a nice experience. My main complaint right now is that it's quite a bit of work to build authentication. I think there are some examples somewhere that show you how to do it. But given, how common it would be for people to use authentication, it should be built in as a first-class object.
Thanks for the feedback. I work on Reflex and in a recent release, the team added a template and CLI for creating third-party components and publishing them to PyPI. Since then, I've built a few authentication libraries that might be of interest: https://github.com/masenf/reflex-local-auth https://github.com/masenf/reflex-magic-link-auth https://github.com/martinxu9/reflex-google-auth (documentation WiP) The problem…
However, I am concerned that the @reflex_local_auth.require_login decorator [1] merely redirects users to the login page.
> Although this seems to protect the content, it is still publicly accessible when viewing the source code for the page! This should be considered a mechanism to redirect users to the login page, NOT a way to protect data.
So, I have to put an if-else condition on the State data associated with each protected page, in addition to this decorator. The reasonable way to do it would be for the decorator to actually prevent any data load at all before redirecting. This will prevent a lot of mistakes, besides removing boiler plate.
Re: Designing a Pure Python Web Framework
#25I have used this to build an internal tool, and that was quite a nice experience. My main complaint right now is that it's quite a bit of work to build authentication. I think there are some examples somewhere that show you how to do it. But given, how common it would be for people to use authentication, it should be built in as a first-class object.
For context, we're a more niche cousin to Reflex that's specifically designed to build internal tools. Reflex seems to be a more general framework to build anything you want; quite powerful, and possibly an easier to use Django replacement.
It's awesome to see frameworks like Reflex. I think the Python ecosystem needs this.
Re: Designing a Pure Python Web Framework
#26Re: Designing a Pure Python Web Framework
#27Re: Designing a Pure Python Web Framework
#28Another one? How many web frameworks does Python need?
Re: Designing a Pure Python Web Framework
#29Earlier quoted context omitted.
Thanks for the feedback. I work on Reflex and in a recent release, the team added a template and CLI for creating third-party components and publishing them to PyPI. Since then, I've built a few authentication libraries that might be of interest: https://github.com/masenf/reflex-local-auth https://github.com/masenf/reflex-magic-link-auth https://github.com/martinxu9/reflex-google-auth (documentation WiP) The problem…
Thanks. This helps a lot. However, I am concerned that the @reflex_local_auth.require_login decorator [1] merely redirects users to the login page. > Although this seems to protect the content, it is still publicly accessible when viewing the source code for the page! This should be considered a mechanism to redirect users to the login page, NOT a way to protect data. So, I have to put an if-else condition on the Sta…
Re: Designing a Pure Python Web Framework
#30I'll give it another try in the future.