Skip to main content
Help us improve Python packaging – donate today!

UNKNOWN

Project Description

fresco-flash provides a mechanism for displaying messages to end users in a web application. Messages can be sent across requests: you can generate a message in a view that returns a redirect response and the message will display on the next page loaded.

Example usage:

from fresco import FrescoApp
from fresco_flash import FlashMiddleware, flash

# Create a fresco app with the flash messaging middleware enabled
app = FrescoApp()
app.add_middleware(FlashMiddleware)

# Create some flash messages to be shown to the user
flash.info('Thanks for signing up!')
flash.warn('Did you remember to feed the cat?')
flash.error('Too many elephants: increase bun supply before proceeding.')

# Display messages to the user
<py:for each="level, item in flash.messages()">
    <div class="message $level">$item</div>
</py:for>

Including HTML in messages

Messages are automatically escaped for HTML using MarkupSafe. If you want to include unescaped HTML in flash messages, wrap them in markupsafe.Markup first:

from markupsafe include Markup

flash.info(Markup('<blink>Insert coin for new game</blink>'))

0.1

  • Initial release

Release history Release notifications

This version
History Node

0.1

History Node

0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fresco-flash-0.1.tar.gz (5.1 kB) Copy SHA256 hash SHA256 Source None Apr 27, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page