Flask Tutorial #6 - Message Flashing

preview_player
Показать описание
In this flask tutorial I will be showing how to flash messages on the screen. Flashing messages is very easy and a good way to make your website more responsive.

Text-Based Tutorial: Coming Soon

◾◾◾◾◾
💻 Enroll in The Fundamentals of Programming w/ Python

◾◾◾◾◾◾

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

Tags:
- Tech With Tim
- Python Tutorials
- Flask Tutorial
- Flask Messages Flashing
- Message Flashing Flask
- Flask Python

#Python #Flask
Рекомендации по теме
Комментарии
Автор

3:40

For people that wanna do the same thing, just change the "href" of the button on "base.html"

Example:
You wanna go to login page, so instead of "#" on the href, set it to "login"

krultu
Автор

great tutorial: But could you user while loop for flashing massages ?

HairusBag
Автор

How to get that navigation dropdown at 3:40

karthikarumugam
Автор

You are Awesome Tim. You have the best tutorials and your way of explaining is great.

robinsingh
Автор

@Tech With Tim -- at @8:49 to resolve that issue with flash( f"...{user}..." ), just move the flash() to AFTER you complete the session.pop -- because that returns the value of who just got logged out, and thus you can pass that into your flash( f"...string..." ).

DarrenSemotiuk
Автор

Thank you for your Flask Tutorial. Your video was literally the highlight of my life so far

JoshKonoff
Автор

@4:55 there is some audio artifact but other than that the vidoe and the whole series is very educational and enjoyable.

Majnik_
Автор

Great video!! if we want to display message as alert box, type like this in the block in html page




{% with messages = get_flashed_messages() %}
{% if messages %}
{% for msg in messages %}
<p id="p1" style="display: none;">{{msg}}</p>
{% endfor %}
{% endif %}
{% endwith %}
<script>
var
window.alert(m)
</script>

bbganeshkumar
Автор

Great tutorial! Thanks.
I followed along and now I have question.
In the base.html I put 2 variables: content and name. And when I call render_template all is fine. But if use e.g. redirect(url_for("user")) then the places where the variables go into stay empty (of course ;-) ) - How to I tell the redirect(url_for()) to use these values as well?

naturheilkunde-kanal
Автор

the last error was working for me somehow n i have no idea what im doin lol

SG-llqt
Автор

Naming everything user and not changing it up even a little bit (usr, user_vari, etc) makes it very complicated Tim

deckplate
Автор

same as php with differents codes like {{}} %% etc ..i am php profi and i am now trying to learn python with web alot of Sir..you are a genial teacher ...god bless you and your familly

لنتسقطامةرسولهامحمدوصاحبهعمرال
Автор

I think you have to add requirements before tutorial, for example: 1) HTML, css, Js 2)Python dictionary 3)Python loops and etc

thegaribovv
Автор

how did you make the flasj message for user login- i dont see the message - you have beenn logged in

unboxingaction
Автор

Great vids series Tim

B.T.W couldn't find the NavBar you're using in bootstrap
can you refer to it?

Thx

omerg
Автор

do you really need to write the html block? My message gets flashed without it. Is this block only useful if one needs to display several messages?

NataliaRevenga
Автор

Really enjoying the series!
However, could you show us how to enter some values on one page, then get redirected to another page where a chart has been made based on those values.

hejhej
Автор

Can you tell me how to modify the nav bar?

jayden
Автор

I have a problem. When I make all this in "login.html", I become an error that 'get_flashed_massages' is undefined

ПерсіДжексон-жи
Автор

can we get the text based tutorial plss

dhm