bottle_flash
============
This plugin enables flash messages in bottle. Again, learn by example
::
from bottle import Bottle
from bottle_flash import FlashPlugin
app = Bottle()
COOKIE_SECRET = 'super_secret_string'
app.install(FlashPlugin(secret=COOKIE_SECRET))
app.post('/create_user')
def create_user():
# Create the user
app.flash('Created !')
To consume the flashed messages, you would do something like the following (jinja2). Here I am assuming that I get the "app" in the template context. This can be achieved with the bottle_renderer_ plugin.
::
{% set messages = app.get_flashed_messages() %}
{% if messages %}
<div id="flash_messages">
<ul>
{% for m in messages %}
<li>{{ m[0] }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
============
This plugin enables flash messages in bottle. Again, learn by example
::
from bottle import Bottle
from bottle_flash import FlashPlugin
app = Bottle()
COOKIE_SECRET = 'super_secret_string'
app.install(FlashPlugin(secret=COOKIE_SECRET))
app.post('/create_user')
def create_user():
# Create the user
app.flash('Created !')
To consume the flashed messages, you would do something like the following (jinja2). Here I am assuming that I get the "app" in the template context. This can be achieved with the bottle_renderer_ plugin.
::
{% set messages = app.get_flashed_messages() %}
{% if messages %}
<div id="flash_messages">
<ul>
{% for m in messages %}
<li>{{ m[0] }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
Metadata
Release files for bottle-flash 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bottle-flash-0.1.tar.gz | 1.7 kB | Details |
Release files / bottle-flash-0.1.tar.gz
| Download URL | bottle-flash-0.1.tar.gz |
|---|---|
| Size | 1.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a7ca08e724ce0d0b78ce82223825771508ee3fb6b0c691fb400c499d8bb03182
|
|
BLAKE2b-256 checksum How to use checksums |
200bb5acbe4ea5e6bb6ab340091bf443029c2f1f85b1ddb43bf64400a91460d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |