It's always interesting to see how number of viewers drop as we progress towards the end of pretty much all programming series out there. The law of statistics never disappoints.
Hey Tim, i wanted to point out that when you use CSS as for blueprint you have to change href="{{url_for('static',filename='style.css')}} to href="{{url_for('second.static',filename='style.css')}} when referencing the CSS code. Thank you very much for your videos, i have learned a lot😀 from them
Thanks for explaining it so clearly! All the documentation I was reading kept talking about app factories; this is a much clearer way to explain the basics.
Hi Tim, thanks for this great tutorial. I very much like the way you introduced us to flask. One thing that may be helpful to others: For me, it did not work instantly for the blueprint to access the static folders, i.e. I had an issue both showing the image and loading the css file. Finally, I found I had to change the variable 'static' in the url_for argument to 'second.static' for everything to work...
For anyone who’s migrating templates for a complex app structure... flask adds the package specific templates to the search path as opposed to just making the package look internally. This means if you have multiple templates with the same name, e.g. home.html, it will render the first one it finds...
No matter if I add the template_folder / static_folder, its gonna use the default ones. for ex., I said "template_folder="admin_templates", but when I entered localhost:5000/admin/ , it rendered the index.html in the "templates" folder, not the one in "admin_templates".
If anyone is curious, this kid's name is REDACTED_FOR_PRIVACY. I like to find peoples' names who don't seem to want to make them available. That's REDACTED_FOR_PRIVACY, folks.
@@TechWithTim Yeah, for me. It's what I do. It took me all of 30 seconds, though. I've unearthed some pretty hidden people, which took years of research and investigation. I'll go ahead and change my comment, though. I don't like to put people on blast. Or do I?
After setting up the separate folders with their own templates and static can you still extend from the main app. Eg. Main app has a layout.html has a top bar nav. Main section with a block content and footer and extend that out to an admin/templates/login.html
very useful, i made a small app but the main file was getting huge, this is like the html files and js files where you import the js file instead of putting all the js code inside the html right?
Dude can you do data structures implementation in python and take it to Advanced level? Or strech your artificial intelligence course to Advanced. Need em badly , i learned a lot lot from you
Hi Tim, Thanks for your videos! Not sure if you could help me with the problem I am having... I am trying to display in a loop, all the images I have in a folder called 'images' under the folder 'static' if the images are into the folder 'images' are not displaying but if the images are in the folder static are displaying. This is what I got and it's working when the images are in the root of the folder 'static' {% for image_name in image_names %} {% endfor %} but I would like to put the images in the folder 'images'. How do I add '/images/ in the path? I have tried diferent ways but not succes Thanks,
I had the same problem. I got 404 for static files: "/static/styles/style.css HTTP/1.1←[0m" 404" I found the solution here: github.com/pallets/flask/issues/348 I had to use a period (.) before static in the .html files to solve it: "{{url_for('.static', filename='styles/style.css')}}"
Do you import second from "second=" or the "second" used withing the Blueprint as name? So if I do not like to use second and second but 2 different names? Thanks
Respected sir, I have one question that is , Why blueprint instance have same name as a first argument in it. e.g. = Blueprint('second', __name__). why "second" repeated two times. are those two different. thank you.
You probably meant a package. A module is just a python file. There is no need for an empty __init__.py to import from a folder, but to make things simpler for future reuse of the contents of the folder as a library, you can specify imports inside the __init__.py file in a following syntax: from package.module import object And later in main, you would just: import package To use the actual contents of the package, you would use the syntax: variable_from_the_package = package.variable1 instance_of_a_class_from_the_package = package.Class1()
Hey Tim, thank you for this I've really enjoyed it. I've been following your ML stuff also and I saw on one of your projects vids that you were able to run your recognising handwritten digits code on the browser. I've written code that allows you to classify a digit you draw using a model you have saved but I coded it using Pygame. Is there an easy way of running pygame code on a browser or did you write yours in JS or other?
How my blueprint access objects in the main app? How my blueprint access the database? How my blueprint access the main app's config? Your tutorial only works for static webpages, nothing more. You did not explaing anything about "context" or using "current_app". If you don't want to talk about it, at least leave a warning for people to know they have to look for more information. I hope that when people try to convert their apps through your tutorial, they find out quickly it is incomplete. So, they won't expend too much time thinking their code is broken.
FLASK IS MOR BETTER THAN DJANGO.................................DJANGO HAS MANY COMPLICATED BAGAGES........BUT FOR SERVER STUFF AND EASY CLEARLY ALGORITHMUS PHP STAY THE BEST
It's always interesting to see how number of viewers drop as we progress towards the end of pretty much all programming series out there. The law of statistics never disappoints.
Yes it with all the tutorials.Longer the tutorial more the drop.
Nice notice, ty!
Dunning kruger effect
This is what we need more after referring docs .....Thanks Tim....wish you would do more videos on Flask like this.....
@Kristian Uriel howz this relevant loll
Hey Tim, i wanted to point out that when you use CSS as for blueprint you have to change href="{{url_for('static',filename='style.css')}} to href="{{url_for('second.static',filename='style.css')}} when referencing the CSS code. Thank you very much for your videos, i have learned a lot😀 from them
Thanks bro, my custom css was not working and I became to wonder why. Then I did what you said and works fine =)
Thanks a lot, image was not loading but now thanks to your comment it does.
Thanks from 💙💛
thanks👍
thanks a lot for that bro
You make the best python videos in the world! I recommend your channel for python learners. Thanks again!
Best explained tutorial on Blueprints that I've seen. Very concise, and covers so much in 13 minutes. Super.
Thanks for explaining it so clearly! All the documentation I was reading kept talking about app factories; this is a much clearer way to explain the basics.
This guy is definitely the best python youtuber
This was immensely helpful, read through the docs and was confused. You are awesome.
Hi Tim,
thanks for this great tutorial. I very much like the way you introduced us to flask.
One thing that may be helpful to others: For me, it did not work instantly for the blueprint to access the static folders, i.e. I had an issue both showing the image and loading the css file. Finally, I found I had to change the variable 'static' in the url_for argument to 'second.static' for everything to work...
tysm
thank you so much, I have been looking like 2hrs just to solve this issue. thanks a lot!
thankssss
thanks
+1 for this being necessary
For anyone who’s migrating templates for a complex app structure... flask adds the package specific templates to the search path as opposed to just making the package look internally. This means if you have multiple templates with the same name, e.g. home.html, it will render the first one it finds...
Thank you so much, Tim, for all your tutorials, they are amazing!
Nice seeing all this Flask content, Tim!
Thanks Tim, these series really gave me a kickstart for my project !!
Thanks, nice content :) Hi from Turkiye!
You are the best because I was looking for what is init and why, how uses it 💪💪
Its crazy how much i can learn for free just on youtube!!
Yet another fantastic tutorial. Thank you.
Wow I really liked this video man, very simple but still very good ! thank you
Thks Tim ! Great videos, nice and clear ; can't wait for the next ones.
Just Awesome, Bro!
superb tutorial - very clear and concise - thank you!
at 11:24 wouldn't our import statement be "from admin.template import second" ?
Excellent explanation, Thanks for sharing 👍🏽
Very nice beginners tutorial. Thanks
This is a really great tutorial. help me a lot.
Hi Tim
Thanks for the video and it was very useful
Thank you this is what i was looking for.
Thank you so much for making these tutorials!
No matter if I add the template_folder / static_folder, its gonna use the default ones. for ex., I said "template_folder="admin_templates", but when I entered localhost:5000/admin/ , it rendered the index.html in the "templates" folder, not the one in "admin_templates".
God Bless you tim. 🔥🔥🔥🔥
well explained; thanks man 👍
Thank you for demonstrating!
If anyone is curious, this kid's name is REDACTED_FOR_PRIVACY. I like to find peoples' names who don't seem to want to make them available. That's REDACTED_FOR_PRIVACY, folks.
Lol it’s pretty easy to find my name
@@TechWithTim Yeah, for me. It's what I do. It took me all of 30 seconds, though. I've unearthed some pretty hidden people, which took years of research and investigation. I'll go ahead and change my comment, though. I don't like to put people on blast. Or do I?
Hi Tim! Can you make a video about the software you use?
what a great tutorial, keep it up
good tutorial video, thank you!
can you like for example share sessions between the two python files? or do you need some external file?
how can use mysqldb in these blueprints?? i can create the mysql connection on the main file, but i can't do it with the blueprints
Thanks for the session. Can we add Blueprints in flask classify? if yes, how can we add the same?
After setting up the separate folders with their own templates and static can you still extend from the main app. Eg. Main app has a layout.html has a top bar nav. Main section with a block content and footer and extend that out to an admin/templates/login.html
very useful, i made a small app but the main file was getting huge, this is like the html files and js files where you import the js file instead of putting all the js code inside the html right?
Nice explanation
will i be able to get data from my db created in another file?
Dude can you do data structures implementation in python and take it to Advanced level? Or strech your artificial intelligence course to Advanced. Need em badly , i learned a lot lot from you
I already reading qr code using flask and check it if it is accommodate thr png picture. But how can go to another html page after that
Thanks, loved it
Hi Tim,
Thanks for your videos!
Not sure if you could help me with the problem I am having...
I am trying to display in a loop, all the images I have in a folder called 'images' under the folder 'static'
if the images are into the folder 'images' are not displaying but if the images are in the folder static are displaying.
This is what I got and it's working when the images are in the root of the folder 'static'
{% for image_name in image_names %}
{% endfor %}
but I would like to put the images in the folder 'images'.
How do I add '/images/ in the path?
I have tried diferent ways but not succes
Thanks,
thanks for the video 👍👍👍👍
After i moved my folders and the second.py the styles.css and the image does not work anymore. Do you know why and how to fix it?
@@bve6198 it still doesnt work for me. Any other ideas?
I had the same problem. I got 404 for static files: "/static/styles/style.css HTTP/1.1←[0m" 404"
I found the solution here: github.com/pallets/flask/issues/348
I had to use a period (.) before static in the .html files to solve it: "{{url_for('.static', filename='styles/style.css')}}"
Do you import second from "second=" or the "second" used withing the Blueprint as name? So if I do not like to use second and second but 2 different names? Thanks
From file name import variable name
Respected sir,
I have one question that is , Why blueprint instance have same name as a first argument in it. e.g. = Blueprint('second', __name__).
why "second" repeated two times. are those two different. thank you.
¿How to pass mysql cursor as a blueprint argument? This is needed for database operations inside the routes functions
Hi! Can I use flask for big projects? (practice)
i dont get why when i remove the __init__ from my blueprint folder, things continued to work as expected?
Could you please do the same like creating multiple modules for flask_sqlalchemy....not able to find much helpful video
After I moved the static and templates folder to the admin folder, the images and CSS files were not working. Could someone please explain?
why the css file is not working in the home.html i made a image and a text with css code but i doesn't work and i don't know why is not working
Nice tutorial, kinda wish you also posted the source code for all your files, that would be nice
Will you make tutorials on 3d games?
how do you use session between different files?
Excellent
cool tutorial
How can I read a qr code for login flask app.. Please help
Just adding a note: since python 3.3 there is no need for an empty __init_py file anymore when creating a module. www.python.org/dev/peps/pep-0420/
You probably meant a package. A module is just a python file.
There is no need for an empty __init__.py to import from a folder, but to make things simpler for future reuse of the contents of the folder as a library, you can specify imports inside the __init__.py file in a following syntax:
from package.module import object
And later in main, you would just:
import package
To use the actual contents of the package, you would use the syntax:
variable_from_the_package = package.variable1
instance_of_a_class_from_the_package = package.Class1()
@@HubertRozmarynowski You are 100% right. Thank you very much for the information.
cant we just import without blueprint ?
what is I wanted to have /admin/something/somethingelse ?
@second.route('/something/somethingelse') try that
hello tim can we change the website name????????????
Wheres the "link in the description"?
In the description
Hello may i know what packages are you using in your Sublime Text Editor?
Hey Tim, thank you for this I've really enjoyed it. I've been following your ML stuff also and I saw on one of your projects vids that you were able to run your recognising handwritten digits code on the browser. I've written code that allows you to classify a digit you draw using a model you have saved but I coded it using Pygame. Is there an easy way of running pygame code on a browser or did you write yours in JS or other?
thank you
thank you my black brother\
routes
__init__.py
home.py
about.py
templates
home.html
about.html
necesito que sean separados algo parecido
I need something similar to be separated
do have a patreon account
patreon.com/techwithtim
@@alternateracoon4872 thanks
How many thing do you know you know how to make web app u know how to make GUI app u know to make mobile app bro
How my blueprint access objects in the main app?
How my blueprint access the database?
How my blueprint access the main app's config?
Your tutorial only works for static webpages, nothing more.
You did not explaing anything about "context" or using "current_app". If you don't want to talk about it, at least leave a warning for people to know they have to look for more information.
I hope that when people try to convert their apps through your tutorial, they find out quickly it is incomplete. So, they won't expend too much time thinking their code is broken.
FLASK IS MOR BETTER THAN DJANGO.................................DJANGO HAS MANY COMPLICATED BAGAGES........BUT FOR SERVER STUFF AND EASY CLEARLY ALGORITHMUS PHP STAY THE BEST
Better spelling NOT included. Spell Tripple again!