-
Notifications
You must be signed in to change notification settings - Fork 86
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
Flash messages support #25
Comments
I think it will look better as a separate package because it brings some dependencies like |
Do not follow, it is couple of methods: Do not see why it should depend on |
Because flash messages doesn't make much sense without templates. And I think there is not so much code to split it into parts. Exactly it took 22 loc in my last implementation: https://gist.github.com/imbolc/ca43545ca31329b4f9e2 |
Also, this approach has benefits of brevity:
instead of
|
@imbolc Another interesting question is API for CSRF checks BTW. |
I also do not understand how flash depends on template engine. |
I created the simple session flash library based on @imbolc's gist: https://github.com/IlyaSemenov/aiohttp_session_flash It has a few enhancements over the original gist:
|
I did not know about the flash example and I implemented my own thing. I didn't use middleware though. I did this:
Is the middleware just so that we can access via request? Would be great to have the flash example commented. |
Here is my super flash function: (I used with jinja2) flash.py
app.py
index.html
|
Do we need some sort of flash messages support? Or may be this feature is out of scope of aiohttp_session?
Most frameworks have flash messages:
pyramid: http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/sessions.html#flash-messages
flask: http://flask.pocoo.org/docs/0.10/patterns/flashing/
Particularly pyramid has it integrated to session object.
The text was updated successfully, but these errors were encountered: