Python Forum
Flash is not working in flask
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flash is not working in flask
#1
I have written a simple code ,but flash is not showing any message .
Code -
flash('OK. The User ID is x')
return redirect(url_for('about'))
about.html-
<html>
  
  <head>
     <title>Welcome </title>
  </head>
  <body>
  <div class ="container">
     
  {%  with messages = get_flashed_messages() %}
 {% if messages %}
   <ul class =flashes>
   {% for message in messages %}
     <li>{{ message }}</li>
   {% endfor %}
   </ul>
 {% endif %}
{% endwith %}
     </div>
     
  </body>
</html>
Reply


Messages In This Thread
Flash is not working in flask - by sahilsiddharth - Jun-14-2017, 09:44 PM
RE: Flash is not working in flask - by buran - Jun-15-2017, 08:14 AM
RE: Flash is not working in flask - by nilamo - Jun-30-2017, 04:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  code not working when executed from flask app ThomasDC 1 927 Jul-18-2023, 07:16 AM
Last Post: ThomasDC
  Help with getting a led to flash. corsasri 10 4,220 Aug-06-2020, 05:14 PM
Last Post: DPaul

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020