Pytonik Bootstrap Flash Message
Pytonik Bootstrap Flash Message helps you store messages in session data until they are retrieved. Bootstrap compatibility, sticky messages, and more
Installation Guide
Step 1:
You can simply install the module into your pytonik application using any of the methods below.
With Pip
pip install FlashBootstrap
With Git
git clone https://github.com/emmamartins/FlashBootstrap/
Step 2:
Import the module using either of the following method
from FlashBootstrap.FlashBootstrap import FlashBootstrap
or
from FlashBootstrap.FlashBootstrap import *
Step 3: Default Parameter
description = ""
title = ""
dismissible = True
key = 'flash'
Basic Usage
msg = FlashBootstrap
msg.info('This is an info message')
msg.success('This is a success message')
msg.warning('This is a warning ')
msg.error('This is an error ')
msg.message('This is an info message')
msg.display()
msg.clear()
msg.redirect('/location')
Message Types
Info
msg.info('This is a info message')

Success
msg.success('This is a success message')

Warning
msg.warning('This is a warning ')

Error
msg.error('This is a error')

Redirect
It is possible to redirect to a different URL before displaying a message. For example, redirecting from checklogin back to a form login, (and displaying an error message) so a user can correct an error - subjected to pytonik developers.

from FlashBootstrap.FlashBootstrap import *
def checklogin():
FlashBootstrap.error('Cannot login account')
return FlashBootstrap.redirect('/login', True)
Alternative
from pytonik.Web import app
from FlashBootstrap.FlashBootstrap import *
def checklogin():
FlashBootstrap.error('Cannot login account')
return app.redirect('/login', True)
Author
👤 Raphael Essien
🤝 Contributing
Contributions, issues and feature requests are welcome!
Show your support
Give a ⭐️ if you like this project!