Это видео недоступно.
Сожалеем об этом.

How to Use Flask-SQLAlchemy With Flask Blueprints

Поделиться
HTML-код
  • Опубликовано: 1 фев 2022
  • In this video, I will show you how to use Flask-SQLAlchemy and other Flask extensions with the blueprints and create app pattern in Flask.
    Need one-on-one help with your project? I can help through my coaching program. Learn more here: prettyprinted....
    Get the code I wrote in this video: prettyprinted....
    Twitter: / pretty_printed
    Github: github.com/pre...

Комментарии • 98

  • @alantchunay
    @alantchunay 5 месяцев назад +3

    Friend, I don't even speak your language, I'm using Google Translate just to say thanks. Because I had problems with the blueprint with sqlchemy and your video helped me perfectly, thank you very much!

  • @dipnarayansen4751
    @dipnarayansen4751 Год назад +2

    sir, Ive been searching the whole internet and this is exactly what Ive been looking for.... Thanks a lot for creating such a amazing video

  • @JustMeZeed
    @JustMeZeed Год назад +2

    Very good and helpful video! This addressed exactly the issues I was having with circular imports.
    Thank you!

  • @Peterstavrou
    @Peterstavrou 2 года назад +3

    Amazing videos as usual!
    You should create a video on testing Flask apps with pytest and how to use logging with flask so when it crashes you get an email and know exactly what went wrong.
    These tutorials will make a great contribution to your already awesome collection.

  • @jplappa1
    @jplappa1 2 года назад

    Thanks dude. I don't even wanna know how much I've wasted time for trying to solve this alone. This was an answer all to my problems. Cheers!

  • @jagdish1o1
    @jagdish1o1 Год назад

    You taught me how to use flask

  • @nasserbader6276
    @nasserbader6276 3 месяца назад

    Thank you so much for your video, you've saved my nick my dear

  • @ayushdedhia25
    @ayushdedhia25 2 года назад

    Thank you so much sir for this awesome tutorial. I was struggling with it since a while now. Finally google recommended your video and my issues are resolved. A huge thanks ❤️

  • @just_eric
    @just_eric Год назад

    Dammm bro, you are really good at explainings things and going to the point, and why certain thing goes where it goes, not just typing it and let the viewer figure it out, thanks a lot for that.

  • @snamone
    @snamone Год назад

    Your tutorials on Flask are amazing! I am going to have to save up my pennies so that I can use your mentoring services. Great video!

  • @davinci2977
    @davinci2977 Год назад +1

    Still saving lives a year later

  • @Richard-of9hd
    @Richard-of9hd 5 месяцев назад

    Great video thanks for the input!

  • @zeeshanhaiderkhan206
    @zeeshanhaiderkhan206 Год назад

    Was Looking for File Directory Method. Thank You!!!!

  • @user-hw1yp1wo7k
    @user-hw1yp1wo7k 2 года назад +2

    Thank u so much. It really helps me.

  • @TehPwnerer
    @TehPwnerer Год назад

    Finally! Came across Uber Chad bro on this topic, I've been sipping on soy boys for too long trying to wrap my head around this and you nailed it; thx Flask brah.

  • @gregocanepa
    @gregocanepa 2 года назад

    Awesome video as always!! Just as a comment, the audio is a bit low but nothing that putting headphones wont solve. Thanks for the great content!

  • @branmuller
    @branmuller Год назад

    Great video! Came looking here to solve this issue and this video is perfect, can I buy you a coffee?

  • @abdulnafihkt4245
    @abdulnafihkt4245 8 месяцев назад +1

    Soo clean

  • @programminglogs2134
    @programminglogs2134 Год назад

    Awesome sir, I got my solution.... Thanks a lot

  • @Dipenparmar12
    @Dipenparmar12 Год назад

    Very good explanation. Thanks keep it up brother.

  • @vimmasi1
    @vimmasi1 8 месяцев назад

    Man, you're a genius!

  • @sahilsharma2867
    @sahilsharma2867 7 месяцев назад

    You are especially good at these python tutorials

  • @eduardmart1237
    @eduardmart1237 Год назад

    Great tutorial! Nice and easy ton understand explanation!
    Please make more about flask application structure and celery.
    Why do usually people use flask context to use with celery? what are the advantages?

  • @adaum79
    @adaum79 2 года назад +2

    Great. Could you Just increase The font size?
    another question..where would you put your business logic classes? some tutorials save it to "entities" others leave it with the database models.

  • @SunnyKumar-ll9nn
    @SunnyKumar-ll9nn 2 года назад

    Man , was just searching for this .

  • @Woodat
    @Woodat 2 года назад

    Exactly what I needed. Thank you!

  • @tompis1442
    @tompis1442 2 года назад +3

    Amazing video! Can you please make a tutorial on making models that have 3 tables user, planes, hangers and all connected to each other. Lets say a user has a plane that is stored in a hanger he also has and the hanger has the data of the plane that this specific user has? Very complicated. Thanks

    • @prettyprinted
      @prettyprinted  2 года назад +2

      Check out my one-to-many relationships and one-to-one relationships videos.

  • @yourbuddyles
    @yourbuddyles Год назад +1

    Thanks for sharing this. It was very helpful. I did get stuck however at the steps at 7:00 (python statements to run create_all(app). Turns out that flask-sqlalchemy was updated to remove that method which accepts the application as a parameter. To do this now, you need to call
    with app.app_context():
    db.create_all()"
    The rest of it worked just fine. Thanks again for putting this together!

    • @kelvinyeung3394
      @kelvinyeung3394 Год назад +1

      Hello.can you please tell me more details about this bug? Where and when should I input those code you mentioned above? Thanks!

    • @andremillet
      @andremillet Год назад

      @@kelvinyeung3394 still waiting on this ;)

    • @atchathomas1885
      @atchathomas1885 Год назад

      Any solution ?

    • @yourbuddyles
      @yourbuddyles Год назад

      I put it in the create_app() function towards the bottom of the function. It’s in the top level __init__.py file. Hope that’s helpful. Sorry for the delay

    • @vidafuku
      @vidafuku Год назад

      Thank you ! I still get an error, but the database is created !

  • @drac8854
    @drac8854 2 года назад +2

    you could make folders like models , routes and forms
    but what i usually do is create blueprint for every part of my app
    example if i am making a e-commerce website (Which i am procrastinating at)
    i would create blueprint for
    1 user
    1.1 orders
    2 product

    • @prettyprinted
      @prettyprinted  2 года назад +1

      Yup that works as well. It's similar to the default Django approach.

  • @i701Dev
    @i701Dev 2 года назад

    Awesome video! i have been waiting for this.

  • @jesterlw
    @jesterlw Год назад

    Solid tutorials man!

  • @kpm25
    @kpm25 3 месяца назад

    Subscribed! Which flask app hosting service would you recommend I use?

  • @yomajo
    @yomajo 2 года назад +2

    I feel like title "How to create flask factory app with extensions" would be more descriptive title, nonetheless thank you!

  • @open-source243
    @open-source243 Год назад

    how much I thank you, You are the best :)

  • @rahularora37
    @rahularora37 4 месяца назад

    Can someone help. What if I have to use app.config['SOMETHING] inside routes ?

  • @raphaelcom1able
    @raphaelcom1able 2 года назад

    you are awesome, i have to finish my project until tomorrow and this helped me a lot

  • @paweszczepanski6738
    @paweszczepanski6738 Год назад

    THANK YOU !!!!

  • @gastonmorales3619
    @gastonmorales3619 Год назад

    Awesome! There is something that I can return an entrie list to the client side?

  • @grimonce
    @grimonce 2 года назад

    How can we extend flask-SQLAlchemy to use some more customised alembic backed services, example snowflake?

  • @naveeshgupta
    @naveeshgupta 2 года назад

    hi, can you make a video for encrypting the form data of login page when it getting posted, before it reaches the endpoint. so when it get posted password cannot be seen in the INSPECT window "Networks" in flask without using JavaScript.
    Appreciate for the great video contents made by you.

  • @timbrap4693
    @timbrap4693 2 года назад

    Dude you are a G!

  • @dmbrv
    @dmbrv 2 года назад

    Thanks for this video.

    • @prettyprinted
      @prettyprinted  2 года назад

      You're welcome. Thanks for watching!

  • @freedomoflife4131
    @freedomoflife4131 Год назад

    great video, this is fire

  • @alfredomarcelo5326
    @alfredomarcelo5326 2 года назад

    Execellent video, thanks🤙🏾🤙🏾

  • @raulbenelli5454
    @raulbenelli5454 Год назад

    Thanks

  • @wahhfacts
    @wahhfacts Год назад

    Your tutorials are amazing and I love it. Just one issue with this tutorial is that I get a Error: Failed to find Flask application or factory in module 'myproject'. Use 'myproject:name' to specify one.

    • @wahhfacts
      @wahhfacts Год назад

      I am using python3.11 on an ubuntu jammy os.

  • @claudiamorazzoni
    @claudiamorazzoni 2 года назад

    Thank you for this

  • @fernandojunqueira89
    @fernandojunqueira89 Год назад

    Thanks!!!!

  • @jasoncaleb5056
    @jasoncaleb5056 9 месяцев назад

    thanku!!

  • @chriskeo392
    @chriskeo392 Год назад

    Can I use SQLMODEL?

  • @buxA57
    @buxA57 Год назад +1

    i dont understand how you made flask run work

  • @kerodfresenbetgebremedhin1881
    @kerodfresenbetgebremedhin1881 2 года назад

    Concise!

  • @shyamsarkar1162
    @shyamsarkar1162 2 года назад

    Hello sir, Is is possible to see all the data from "row = Users.query.all()" , by just using " return row ". I don't want to print the data in html using loop, just want to see all data as soon as possible, like php. And thanks ...(I'm from India, always watch your videos)

    • @prettyprinted
      @prettyprinted  2 года назад +1

      I'm sure this is possible in several ways, but I can't think of one that is as simple as PHP. The problem is when you are using SQLAlchemy, you get SQLAlchemy objects in return, so you have to loop over them to see the results. In PHP, you are getting the results directly from the database, so you can show them immediately.

  • @RahulChauhanart
    @RahulChauhanart 2 года назад

    Can u suggest best framework for Flask for creating Restful apis just like Django have DRF?

    • @prettyprinted
      @prettyprinted  2 года назад

      You're probably not going to find a framework in Flask that is on the level of DRF due to differences in the approaches and communities of the frameworks. Check out Flask-RESTX though: github.com/python-restx/flask-restx

  • @whitebat1996
    @whitebat1996 2 года назад +1

    hey man, i've been watching your videos lately, and honestly they've been great so far. I am working on a project and im not quite familiar with the flask environment and folder structure, hence i just wanted to ask you why don't you have an app.py and whats the reason behind using the under init as the root file or the starter of the application, like are there any benefits to that approach. I hope im making sense in what im saying
    edit: another question i have, so when i followed along, it seems that flask migrate wasn't able to find my models, until i imported them in the init file under the migrate.init app line. And now i have the issue of circular imports as i have an association table and its causing an error.

  • @masoom_ldka
    @masoom_ldka 2 года назад

    i have error of models could not be resolved 'how to solve this error' even when m trying to install model error occured

  • @carlos-qs2zs
    @carlos-qs2zs 2 года назад

    muchas gracias!!!

  • @alfredomarcelo5326
    @alfredomarcelo5326 2 года назад

    Are you gonna make videos to database modeling with sqlalchemy and relationship between tables?

    • @prettyprinted
      @prettyprinted  2 года назад +2

      I don't have any plans to make any videos like that for my RUclips channel, but I am working on a course right now that will cover something along those lines.

    • @alfredomarcelo5326
      @alfredomarcelo5326 2 года назад

      @@prettyprinted I am enrolled in your class to flask for beginner in the website, its so cool

    • @MACD69
      @MACD69 2 года назад

      You can do that by adding an import to the models under the models/__init__.py

  • @bigfatcrab
    @bigfatcrab 2 года назад

    I’m so lazy, I keep stopping to program for a week then retry again for a few days then quit again. 😭😭😭

    • @prettyprinted
      @prettyprinted  2 года назад +1

      That's exactly how I started years ago. Those few days that you code start to add up over time, and eventually you might be more motivated to spend more time programming.

    • @bigfatcrab
      @bigfatcrab 2 года назад

      @@prettyprinted thanks Pretty Printer

  • @boris---
    @boris--- Год назад

    amazing to watch whole video than discover nothings work on windows

  • @101kawsar
    @101kawsar 2 года назад

    Flask is so frustrating 😩
    Django life was better :)

  • @davishek7
    @davishek7 2 года назад

    This is such a bad example of structuring a Flask application.

  • @MartyMillerCrispe
    @MartyMillerCrispe 2 года назад

    Another great tutorial, thanks. Do you have a video on using parameters vs variables in routes? I'm curious as to which is best for which situation. For example I can have /myurl/ and pass in a name like /myurl/marty or I can use params so pass in /myurl/?name=marty and pick it up with name = request.args.get('name'). Is there a reason to use one over the other?

    • @RahulChauhanart
      @RahulChauhanart 2 года назад

      Check flask-marshmallow

    • @prettyprinted
      @prettyprinted  2 года назад

      I prefer using the query string (?name=...) because it makes the URLs more discoverable. As your app grows, it helps to be able to take a URL and find out which function is handling that URL. With arguments, in the URL, this becomes harder, especially for other people who will look at your code.

  • @Fantasia1013
    @Fantasia1013 2 года назад

    sir please can you save my life and explain everything about flask context i'm struggling for 1 week now i did not understand anything , and why we should use with app.app_context()... in our __init__.py

  • @whiplash_jm
    @whiplash_jm Год назад

    This has not worked for me. When I enter from ------ import db. I am met with ImportError: No module named flask

    • @thegringlemingler276
      @thegringlemingler276 Год назад +1

      you need to pip install flask

    • @whiplash_jm
      @whiplash_jm Год назад

      @@thegringlemingler276 I had flask installed but I was in the wrong conda environment at the time.. woops.

  • @dimajaykobson7506
    @dimajaykobson7506 Год назад

    Thank you very much! You helped me.