Python Flask Tutorial: Full-Featured Web App Part 11 - Blueprints and Configuration

แชร์
ฝัง
  • เผยแพร่เมื่อ 9 พ.ย. 2024

ความคิดเห็น • 476

  • @howards5205
    @howards5205 5 ปีที่แล้ว +218

    I'm glad how these tutorial series first showed us how to create the app without using blueprints, and later, showed us how to utilize blueprints. I've seen some other tutorials where they started out with blueprints and adopted a complicated application factory paradigm. They were all following good practices, but at the time, I didn't understand WHY they were doing the things they were doing. In these tutorial series, seeing first-hand how the application grows, I was able to see WHY it's necessary to use blueprints and adopt the application factory paradigm. These tutorials are truly awesome!

    • @mr_jacklu8014
      @mr_jacklu8014 4 ปีที่แล้ว +9

      This! Corey, I would love a video where you talk about how you develop a series like this. How long did the planning take? What was your thought process? And did you try to make everything work as intended before filming these coding sessions? Thanks.

    • @ericervin2513
      @ericervin2513 4 ปีที่แล้ว +1

      totally agree, this is what the internet is missing.

    • @EmiliaKaida
      @EmiliaKaida 2 ปีที่แล้ว +1

      Just for this episode, one really confusing thing for me is WHY he used environment variable in an OS scope. Usually env variables should be scoped to app (because for example we might have many Flask apps running on the same system -> name clashing etc... Also, it's a best practice in other frameworks like Spring boot or Node JS)
      It just seems so weird for him to do it this way. Could be really confusing for beginners.

  • @davidyo8922
    @davidyo8922 6 ปีที่แล้ว +93

    By the end of these flask tutorials I finally began to understand Django.

    • @aixiaogui124
      @aixiaogui124 5 ปีที่แล้ว +2

      😂😂😂,same to me

    • @tcarney57
      @tcarney57 5 ปีที่แล้ว +22

      And I more clearly understand why I abandoned Django's sprawl and bloat for the _MICRO_-framework Flask. No multi-tiered grandiosity needed just to put up a fully-functioning website for a small business or non-profit. I personally don't see the value of organizing by purpose ("users" and "posts") instead of by function ("routes," "forms," and "models"), especially since you have to have separate routes, forms, and models for each new subpackage--and then also have catchall subpackages like "main" and "util." I also don't see why I should prefer to root around in a now-more complex directory structure when I can just use my editor's search function to jump to the particular @app.route block I want in a traditional views.py or routes.py module. I doubt I'd ever need more than two or three dozen routes anyway, and I do not consider that too many for a single module--frankly it's a relief in a world of ever-more atomized code. Moreover, who wants to see _two_ or more routes.py (or forms.py, etc) tabs open in their editor, each in a different subpackage that is not indicated on the tab. It could happen easily enough in the heat of battle. I get confused enough as it is. So I'm sticking with . . . what shall we call it? Legacy Flask?

    • @okiseeyou
      @okiseeyou 5 ปีที่แล้ว

      LOL

    • @codewithlenny
      @codewithlenny 4 ปีที่แล้ว +2

      Same to me here. I am just as amazed!!!!! And I am loving flask more

    • @suharsh96
      @suharsh96 4 ปีที่แล้ว +5

      @@tcarney57 I didn't even put my code into 'routes', 'forms' , etc. I prefer it to be just one page containing all 1000 lines worth of spaghetti code "_'

  • @slavoie
    @slavoie 6 ปีที่แล้ว +68

    If like me, you ended up wanting to play with the database after making all the changes that Corey did in this video and didn't know what to do, here is a working solution:
    1) Make sure to activate the appropriate virtual environment to work with all needed packages.
    2) Open a Python interpreter at the root of your project directory (in the same directory as run.py).
    3) Execute the following code (without comments if you wish):
    from flaskblog import create_app, db
    app = create_app()
    # context to run outside the application (no need to launch the server)
    ctx = app.app_context()
    ctx.push() # start working on database after that command
    # Database manipulations here
    # ...
    ctx.pop() # exit from the app
    exit()
    This explanation comes from StackOverflow here: stackoverflow.com/questions/24060553/creating-a-database-outside-the-application-context
    As explained on that same page at StackOverflow, you could use a "with" block like so:
    "with app.app_context():"
    and skip all commands with ctx as shown above, but then you would have to enter everything at once inside the "with" block. If you are going to work directly inside the Python interpreter and not from a script, the first method would be more easy to work with... instead of "with" ;).

    • @feecz8513
      @feecz8513 5 ปีที่แล้ว +4

      Thanks so much for this!

    • @zacklight
      @zacklight 5 ปีที่แล้ว +5

      Thank you for saving my life!

    • @dreezybines4403
      @dreezybines4403 5 ปีที่แล้ว +3

      Thanks Sebastien... This helped a lot

    • @zacharymeyer991
      @zacharymeyer991 5 ปีที่แล้ว +4

      My god you saved my life. I spent the better half of an entire day searching for this..... LOL Corey upvote this!

    • @MiaElliottPhotos
      @MiaElliottPhotos 5 ปีที่แล้ว

      Would you know how to add migrations to it? I cant figure it out..

  • @aarkayin
    @aarkayin 4 ปีที่แล้ว

    Never done coding before but following your videos I could complete a demo site and successfully deployed on pythonanywhere. A paid course also could not have given me this much knowledge and confidence.

  • @pedrov8868
    @pedrov8868 4 ปีที่แล้ว +7

    Reload the terminal if you get an error around 30:30 people :). Thanks so much Corey for all the great pedagogical work you do.

    • @urbaneplanner
      @urbaneplanner 2 ปีที่แล้ว

      cheers! This happened to me!

  • @raysun5889
    @raysun5889 5 ปีที่แล้ว +14

    Damn, a tutorial for unit testing from Corey would be a dream come true.

  • @bugs389
    @bugs389 6 ปีที่แล้ว +82

    You're an amazing teacher Corey 👍

  • @Brayster1842
    @Brayster1842 3 ปีที่แล้ว +1

    I logged in specifically to give you a thumbs up and subscribe. After almost a week of trying to get user login to work with Blueprints I found this video. It helped me solve the problems almost immediately. Thank you.

  • @vitalypark4880
    @vitalypark4880 5 ปีที่แล้ว +2

    Watching previous videos I was wondering, why don't we structure our project properly, but you made a separate video on this topic. Amazing! Thanks for your work.

  • @HACKINGMADEFUN
    @HACKINGMADEFUN 3 ปีที่แล้ว +2

    I am gonna definitely start supporting you on patreon once I start making money. Idk how to thank you but the amount of stuff that I learn just by watching your videos and practicing is just... incredible. The fact that these videos are accessible for anyone without any kind of payment is just mind blowing.

  • @IncomeBoost42
    @IncomeBoost42 2 ปีที่แล้ว +4

    I have to say, it was a real pain to switch to blueprints as I had already added a lot more pages to my own app. But I really love how neatly organised it is now and it’s so much easier to find stuff!

  • @pradhi-das
    @pradhi-das 3 ปีที่แล้ว

    what an amazing playlist this is!!
    In case anyone faces an error like:
    -> AttributeError: 'NoneType' .......
    tip: just close sublime text and refresh after you have secured the database info!
    also, refresh the terminal after saving the virtual environment variables before you close the terminal window using : pip freeze

  • @AbhishekNigam
    @AbhishekNigam 6 ปีที่แล้ว +3

    I am so grateful to you for this video!! Seriously, for a beginner like me, it can take few years to learn all of this, how to architect your app, how to use different configurations in local development and in production. Thanks a lot! Bless you.

    • @coreyms
      @coreyms  6 ปีที่แล้ว

      Glad it helped!

  • @Juanoetdm
    @Juanoetdm 3 ปีที่แล้ว +1

    Well, it's been about two moths I watch this videos and they are awesome, I build my own app. Thank you very much.

  • @praveenjoshi2064
    @praveenjoshi2064 4 ปีที่แล้ว +1

    I like the way you start the concepts and unfold gradually to touch every aspects of it. thumbs up

  • @helmialfathseptiana6383
    @helmialfathseptiana6383 4 ปีที่แล้ว +2

    this 'blueprint' video is the best intro to understanding Django.

  • @zinmin75
    @zinmin75 2 ปีที่แล้ว

    Best playlist ever. Thank you very much. can't imagine how much people spend outside to learn this which even not as good as yours.

  • @shauryadhadwal6031
    @shauryadhadwal6031 5 ปีที่แล้ว +9

    Will definitely start contributing once I land a job. You deserve it man!

  • @question3v3ryth1ng5
    @question3v3ryth1ng5 5 ปีที่แล้ว

    I have been getting really frustrated doing these tutorials. Not by your fault, but just errors or mistakes of my own. But seeing as I finally finished this one, and only got a couple short videos to go, I feel like I am over the hill in this chapter of learning about flask. Not sure if web design is for me, but at least understanding the fundamentals will help me choose where I want to land in this industry. Basically just wanted to put out a huge thanks. I have been moving super slow through these, but you have set it up in a way that's easy and super digestible. I am currently in the middle of fixing up a Jeep and building a new PC. But as soon as those expenses are done I will definitely be donating to you. I really appreciate what you have done. This is great. Helping people learn is a true gift. Thanks, dude. Consider me subbed and following as long as you keep doing awesome stuff!

  • @wabschall
    @wabschall 4 ปีที่แล้ว +5

    Loved this series so far! A slight change that I would make that would keep the ENV portion of this within the scope of Python, would be to use the 'dotenv' library, allowing you to keep a custom .env file in your porject folder. That way the entire project remains portable and easily referenced.

  • @investmentapps7826
    @investmentapps7826 3 ปีที่แล้ว +1

    Excellent, this is needed so much to understand Flask. The debugging is excellent.

  • @nickbejan4914
    @nickbejan4914 6 ปีที่แล้ว +20

    Great tutorial series! Can't wait for the unit tests for this app tutorial ^^

    • @ivanyakushchenko6915
      @ivanyakushchenko6915 6 ปีที่แล้ว

      I guess that in this case it makes more sense to test website using Selenium tool, or something similar - but it will be separate topic then.. Hope one day Corey will have inspiration for such a tutorial =)

  • @lostipod12
    @lostipod12 ปีที่แล้ว

    Thank God for Github. I do a commit after each video in this series once I'm confident that the application works.
    I could not get this one to work after doing the last 'import config' stuff in the last third of the video, so I deleted all the files and ran a $git restore --hard command and got everything back to the way it was at the end of Part 10.
    Off to redo this video!
    Edit: in process of redoing the video. A good spot to set up a git commit is at around 23:14, right after changing the login_manager.login_view variable. Make sure that you can run the app and all the routes work using the new Blueprints before commiting.

  • @hahue4742
    @hahue4742 4 ปีที่แล้ว +11

    At about minute 32:30 after Corey moved the "app..." and the "app.config..." lines into his create_app function he should make one change in the line "app.config..."-line. He should set the value "Config" to "config_class". After that the line reads: "app.config.from_object(config_class)"
    If he misses this, he cannot use different configurations when calling the run.py funktion. He will always use "Config" instead

    • @markzuckerberg6054
      @markzuckerberg6054 2 ปีที่แล้ว

      what do you mean?

    • @shaunmabin
      @shaunmabin 2 ปีที่แล้ว

      @@markzuckerberg6054 Just to clarify - Line 18 (pause at 33:16) is setting a variable config_class in his create_app function. In his function he has set Config to be the default option. When he calls this later he can call it using create_app() which will use the Config as its default option. He can create other configs such as Config1, Config2 etc but in line 20 of his function he should be using config_class instead of Config. Config is just a default value if nothing was passed in when calling the function. Say he does pass in Config1 like create_app(Config1) now it won't work because it is going to only use Config and not look for whatever was passed into the config_class. Hope that makes sense to anyone who was interested.

  • @newsjuice7404
    @newsjuice7404 2 ปีที่แล้ว

    When I get job the very first thing I ll do to support this amazing channel & thank you so very much

  • @yeshh7993
    @yeshh7993 3 ปีที่แล้ว

    Oh man you don't have any idea how many times your videos saved my ass, in the college and now in my job, thanks man

  • @mikec64
    @mikec64 5 ปีที่แล้ว +50

    I think we all need a t-shirt with the Python logo and "Hey there".

  • @lightninginmyhands4878
    @lightninginmyhands4878 5 ปีที่แล้ว +1

    While re-organizing I'm reviewing all my routes and templates. It's a good time to step through the code and workflows.

  • @mu9344
    @mu9344 4 ปีที่แล้ว

    19:50 For PyCharm users on Mac, >>Edit >>Copy>>Copy Path>>Absolute Path>>Edit>>Find>>Find in Path

  • @yalgret
    @yalgret 4 ปีที่แล้ว

    I spent about 30min learning regular expressions using Google (duck duck go for privacy :) ), which was very useful for the find and replace to update the url_for() usage! I recommend this as it's now a powerful tool I have for use in future programming challenges!
    I used: url_for[\(]'[[:alnum:]]*'
    and;
    url_for[\(]'[[:alnum:]]*.[[:alnum:]]*'
    These two find either; the original form of the function before part 11, and, the new form with an added object (and connecting dot).
    I'm using Notepad++ which has regular expression search. Use google to learn regular expressions for your particular editor.
    EDIT: my expressions missed out functions that had underscores in them. It's easily fixed though once you know the syntax.

  • @sreenathramanna8881
    @sreenathramanna8881 6 ปีที่แล้ว +3

    Hi Corey,
    Excellent series. Loved it!!
    One small correction - I think inside the create_app function, the line app.config.from_object(Config) should really be app.config.from_object(config_class). Unless I am missing something.
    Thanks again!

    • @coreyms
      @coreyms  6 ปีที่แล้ว +2

      Yes, you are correct. Someone else pointed that out as well. I will issue a correction in the next video I put out on this series. Thanks again!

  •  4 ปีที่แล้ว +1

    Very clear and good explanations. Best Python and Flask tutorials ever!

  • @Pixelaze
    @Pixelaze 3 ปีที่แล้ว +1

    Learned so much watching these videos. One day when I can, I will contribute to your Patreon.

  • @loveboatcaptain77
    @loveboatcaptain77 6 ปีที่แล้ว +9

    hey corey... thx for this awesome quick guide into flask. as i just discovered it for myself it's great to get this nice overview.
    since i'm still learning python as a hobby i'm struggling in integrating Flask-Admin and Flask-Security to have some basic rights and role management and a nice view for the database.
    could you please consider adding a part for integrating these extensions too? i think that might be useful for extending this awesome video-tutorial.
    i'm also very interested in a basic unit-test or selenium-test integration tutorial for this project.
    also a serializer for an api integration would be awesome... like Flask-Marshmallow... so many ideas but i'm a little to unexperienced to get it all working, all together.
    this would give me a perfect playgroud to teach myself some new stuff and extend this project for my own needs and learn even more... :D
    as a very first customization i was able to integrate ckeditor for the TextArea in the Post.Content... this might be usefull for others to... perhaps another video idea for you and this series.
    my next plans are rights and roles, testing, add images for Posts, categories and tags and of course some other post-types, like pages or media view.
    thank you for inspiring me with every video you post... that i wanted to post under very of your videos... but this seems a little childish :D
    really dude... thank you very much... you teached me very well. some coins for more coffee are on the way :)

  • @W5AKC
    @W5AKC 4 ปีที่แล้ว

    Love the videos, but I think creating these apps should be done this way from the start--"There should be one-- and preferably only one --obvious way to do it."---no matter the size of the app--"Special cases aren't special enough to break the rules"---size should not matter....that way, they can grow without having to refactoring anything.
    I really wish someone with the knowledge would create a tutorial doing it using the Factory App pattern with Blueprints from the get go. I would if I had that knowledge, but I don't.
    Still these are GREAT videos and many thanks to you for creating them.

  • @khinkyi01
    @khinkyi01 4 ปีที่แล้ว

    Thanks for this amazing series of Flask, Corey. I was so thankful that i saw your channel in the beginning of my study journey. Your videos are really easy to understand and You are an amazing teacher for me . Really thanks again for your time and hardwork to make these videos. May God Bless you ...

  • @lightninginmyhands4878
    @lightninginmyhands4878 5 ปีที่แล้ว +50

    Windows users! If you get:
    ```error of 'NoneType' object has no attribute 'drivername',```
    Check if you restarted your terminal :)

    • @TorIvanBoine
      @TorIvanBoine 5 ปีที่แล้ว +4

      hah. thanks. that solved that error :)

    • @jasonrodriguez1995
      @jasonrodriguez1995 5 ปีที่แล้ว +3

      Happened to me on linux too.

    • @jonbrenner565
      @jonbrenner565 5 ปีที่แล้ว +2

      This happens on Mac too - If possible you should edit comment to remove "Windows users!" since it applies to everyone :)

    • @carlospxe
      @carlospxe 4 ปีที่แล้ว

      I had to restart Firefox and the whole Anaconda Navigator in order to work

    • @adirbarak5256
      @adirbarak5256 4 ปีที่แล้ว +1

      I wish I searched for this comment 20 min earlier... THANK YOU

  • @TheTwierdzenie
    @TheTwierdzenie 4 ปีที่แล้ว +14

    After I'll get a new job - I promise you'll be the first one to get a good part of my first salary.

  • @SupharkAwatchanakankul
    @SupharkAwatchanakankul 2 ปีที่แล้ว

    the best tutorial in my life

  • @rafaelrocha8483
    @rafaelrocha8483 4 ปีที่แล้ว +1

    MAN! kkkkkkkkk it was reeeealy anoying to change all the routes and check in my aplication, but i have to thank you for the amazing videos. You really helped me in my career

  • @POTENCY00
    @POTENCY00 3 ปีที่แล้ว +3

    Thanks for this awesome tutorial!!!
    Just wondering that will there be a video talking about how to do unit testing for this application?

  • @ian_senior
    @ian_senior 5 ปีที่แล้ว +1

    you can also ignore directories when using the tree command by using the -I switch (that is a capital i like in ice). Use the | (pipe character) to separate multiple directories. for example, i use this one listed below to ignore pycache and profile pics directories:
    tree -I '__pycache__|profile_pics'

  • @chayanikabohra6722
    @chayanikabohra6722 4 ปีที่แล้ว

    Good one. Thanks ! One suggestion is you should have started the app with blueprints and then add apps ...

  • @ElectricsOj
    @ElectricsOj 5 ปีที่แล้ว +4

    if you have problem with db.drop_all() or db.create_all() try this :
    from yourapp import db, create_app
    >>> db.create_all(app=create_app()) or
    >>> db.drop_all(app=create_app())
    this will help u :)

    • @blingclem
      @blingclem 2 ปีที่แล้ว

      Thank you so much! Saved me hours of searching around. This was my code for db function (put in run.py):
      from flaskblog import db, create_app
      app = create_app()
      if __name__ == '__main__':
      app.run(debug=True)
      db.create_all(app) # Or db.drop_all(app)

  • @nearlyzero9849
    @nearlyzero9849 3 ปีที่แล้ว +1

    Massive thumbs up Corey!

  • @akshaysapra1470
    @akshaysapra1470 3 ปีที่แล้ว

    We should’ve done this from the start 😭😭 so much extra work

  • @truphenalwanga9829
    @truphenalwanga9829 5 ปีที่แล้ว +6

    if a tutorial is too good to be true, its probably Corey's

    • @coreyms
      @coreyms  5 ปีที่แล้ว +1

      Thanks!

  • @johnc5258
    @johnc5258 2 ปีที่แล้ว

    just repeating every other comment: what a great series

  • @kalpanarendarreddy5417
    @kalpanarendarreddy5417 2 ปีที่แล้ว

    I really love your lectures 💕 ❤ 💖 corey..u r the best I've seen..may God bless you with and Good health and wealth u wish for 🙏 ❤ ....and we expect you to continue to share your knowledge on other languages and courses too possibly

  • @emilynolan5471
    @emilynolan5471 4 ปีที่แล้ว +1

    hey corey! loving this series this is my first time using python and flask and really loving it :) just wondering are you going to do a tutorial on unit testing? kind of confuses me and would love to see how its done, again great work thank you!!

  • @PeterAlderton
    @PeterAlderton 5 ปีที่แล้ว +2

    Wow, what a fantastic video. This stuff makes so much more sense.

  • @abdulhamidkhorajiya2256
    @abdulhamidkhorajiya2256 5 ปีที่แล้ว +2

    really learned a lot from this series

  • @bskur6834
    @bskur6834 4 ปีที่แล้ว +1

    Thank you so much for these tutorials Corey

  • @zesty-lemur
    @zesty-lemur 4 ปีที่แล้ว

    For anybody using VSCode, when it comes to updating the routes, do yourself a favour and make use of the Find & Replace using Regex function.
    Using Find with "url_for\('((?!main|posts|user|static))" will give you a list of all the outstanding routes you need to change (once you change them, it'll stop detecting them.
    With a bit of imagination, you could also use F&R w/ Regex to pick out (for example) all the 'main' routes and change them to include 'main'.
    Enjoy!

  • @abeljonathan7324
    @abeljonathan7324 3 ปีที่แล้ว +2

    if you get a runtimeerror like A secret key is required to use CSRF, then you need to close your commendline, open a new one and start the server again, the new cmd will know about the environment variables you just set

    • @Arkssa
      @Arkssa 3 ปีที่แล้ว +1

      Thx for pointing that out, saved me from wasting hour+ on debugging a dead end :D

  • @derricknjoroge2494
    @derricknjoroge2494 5 ปีที่แล้ว +5

    Looking forward to the Unit Testing

    • @ScubaGlenn1
      @ScubaGlenn1 4 ปีที่แล้ว

      Did he ever make one?

  • @saszajanswiatek7519
    @saszajanswiatek7519 4 ปีที่แล้ว

    It is all very confusing, I couldn't really figure out what is happening in this video. The rest of your flask tutorials are golden.

  • @codethemath4759
    @codethemath4759 3 ปีที่แล้ว +2

    Thanks you very much for a great tutorial. I realy appreciate your work.

  • @rwwkv6
    @rwwkv6 6 ปีที่แล้ว +2

    This is an excellent series. Thanks.

  • @andrei31112
    @andrei31112 2 ปีที่แล้ว +1

    If you happen to delete the site.db and want to add your own db, you can add the following code to your run.py:
    from flaskblog import create_app
    from flaskblog import db
    app = create_app()
    with app.app_context():
    db.create_all()
    db.session.commit()
    if __name__ == '__main__':
    app.run(debug=True)
    My rationale for adding this to the run.py is the following (and I might the wrong). The app is created using the factory pattern: since we use app_context(), the db is created within the context correct app. You could run this inside the __init__.py, but you will get circular import references so you would have to do ugly imports at the bottom of the __init__.py just before return app.
    If there is no file called site.db in your flaskblog folder, the above code will create it. If there is a site.db file, it will ignore the code. If you don't initialize the db after creating the app, your app will crash when you call it in the browser as the following statement in the home route cannot execute on an empty posts table.
    posts = Post.query.order_by(
    Post.date_posted.desc()).paginate(page=page, per_page=5)
    The error you will get without the db initialization added to run.py is the following:
    sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: post
    [SQL: SELECT post.id AS post_id, post.title AS post_title, post.date_posted AS post_date_posted, post.content AS post_content, post.user_id AS post_user_id
    FROM post ORDER BY post.date_posted DESC
    LIMIT ? OFFSET ?]
    [parameters: (5, 0)]
    (Background on this error at: sqlalche.me/e/14/e3q8)
    You could probably also condition on the posts table being available and then pass on empty posts to the template in your home route, if the condition is not met, but I think it's not required or not as clean.

  • @davidstranava4057
    @davidstranava4057 4 ปีที่แล้ว +2

    I really like your videos. Thanks very much

  • @Liamreeves
    @Liamreeves 5 ปีที่แล้ว

    Please let me know if this is wrong!! : I was having trouble getting Flask to run again, I kept getting an Attribute Error because the database address had been moved into an environment variable. I tried following Corey's video on Env Var but it didn't work for me on Ubuntu 19. Instead of editing ~/.bash_profile I needed to edit ~/.bashrc. Add you variables to the top of that file, save and reload and you should be good. And thank you Corey, you're an amazing teacher; always straight to the point.

  • @Kennethlumor
    @Kennethlumor 3 ปีที่แล้ว +1

    Sir i want to thank you so much for the video you done all

  • @jeremiahokai9889
    @jeremiahokai9889 4 ปีที่แล้ว +1

    Keep up the good work. Your videos are amazing.

  • @ramil17998
    @ramil17998 4 ปีที่แล้ว +1

    A nice way to display tree structure with colors ignoring __pycache__ is via:
    $ tree -C -I __pycache__
    -C stands color
    -I stands for ignore

  • @pinapple8215
    @pinapple8215 6 ปีที่แล้ว +1

    Just 1 more video for me. Great vids. So much information.

  • @tajudeenalli6640
    @tajudeenalli6640 2 ปีที่แล้ว

    Great and Superb ....nothing less

  • @lightninginmyhands4878
    @lightninginmyhands4878 5 ปีที่แล้ว +1

    FYI
    init_app() - this method is written inside each extension. The init_app method exists so that the extension object (e.g. flask_login object) can be instantiated without requiring an app object.
    flask.pocoo.org/docs/1.0/extensiondev/

  • @Mosil0
    @Mosil0 3 ปีที่แล้ว +1

    Is it really best practice storing sensitive information like passwords in system environment variables? I'm sure it's better than putting it directly into the code, but it still leaves them lying around for anyone who has access to your computer and happens to look there.
    Anyway, this series is terrific, thank you so much!

  • @sseaditya
    @sseaditya 4 ปีที่แล้ว +1

    Thank You for this video series.
    It was a mega help!

  • @alexandredamiao1365
    @alexandredamiao1365 3 ปีที่แล้ว +1

    This tutorial is so good! Thanks!

  • @ivanyakushchenko6915
    @ivanyakushchenko6915 6 ปีที่แล้ว +2

    Great video, thanks a lot for your lessons! Looking forward for unit test videos for this website )))

  • @ajipboy
    @ajipboy 9 หลายเดือนก่อน

    Thank you for the tutorials Corey! Got a noob (hopefully not really a dumb) question here, is the web app a microservices based (or microservices architecture)? Thank you !

  • @branhoff
    @branhoff 3 ปีที่แล้ว +3

    did that unittest video for these kinds of applications ever get posted?

  • @alvinwafulalusenaka1247
    @alvinwafulalusenaka1247 5 ปีที่แล้ว +2

    We appreciate

  • @shivamshah6854
    @shivamshah6854 4 ปีที่แล้ว

    You are amazing teacher thank you for flask tutorieal

  • @investandcyclecheap4890
    @investandcyclecheap4890 2 ปีที่แล้ว

    Great series and Im learning a ton!
    He mentioned multiple application for testing and one for production. Im assuming that after watching this video I can create multiple "Config" classes and run those as my app, one for testing and one for production?

  • @Nidal_C
    @Nidal_C 5 หลายเดือนก่อน +1

    amazing thank you again

  • @AJ-tr4jx
    @AJ-tr4jx 4 ปีที่แล้ว +2

    the impression i got from watching this video after finishing django is like "how to make django application with flask"

  • @wianspamer5979
    @wianspamer5979 3 ปีที่แล้ว +2

    Hi, I love this series. I think I found a problem in the __init__.py file at the create_app function. It should be "app.config.from_object(config_class)" not "app.config.from_object(Config)".

  • @anildhage
    @anildhage 3 ปีที่แล้ว +1

    Hello Corey, I am learning from your video and am at this tutorial about blueprints. I have a question for you, as there is a lot of changes made from the prior structure of files, folders, forms, users, etc to a new system called blueprints, 1. Why didn’t you follow up from the beginning? I can understand why, but want to know your answer & 2. From here on, if I start a different project with flask, should I use blueprints model from the beginning? Please answer. TIA & great content.

    • @anildhage
      @anildhage 3 ปีที่แล้ว +1

      I got the question answered in the end of this video, thanks. Your the best man.

  • @maizhiheimei9080
    @maizhiheimei9080 4 ปีที่แล้ว +1

    Hey, Corey, thank you very much! Awesome videos and I learned a lot, ... by the way, have you made the unit test video yet? really looking forward to it.

  • @brandonjohn2434
    @brandonjohn2434 ปีที่แล้ว

    Thank you for the thorough and detailed explanation on this series, Corey! I have a question now that we have separated the instantiation of the application into a function so that we can create multiple instances of that function with different configuration. However, I am lost as to how to add another column to the `site.db` SQLAlchemy database after I added another column to the `User` model where the additional column is `last_reset_request = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)`. Thank you.

  • @santhoshjallu926
    @santhoshjallu926 4 ปีที่แล้ว +3

    remember to return the app at the end if you get the error NoneType has no attribute run

  • @vikramsingh-xz8ok
    @vikramsingh-xz8ok 4 ปีที่แล้ว +1

    Also, please post some lectures on how to build system with Post and comments relationships. Like you can start with Per post many comments which can be seen on home page

  • @Metachief_X
    @Metachief_X 5 ปีที่แล้ว +1

    excellent content, Corey!

  • @farPositive
    @farPositive 4 ปีที่แล้ว +1

    Hey Corey, Great Tutorials!! Waiting for db migration from SQLite to Postgres/MySQL !!!!

  • @omernahum8336
    @omernahum8336 6 ปีที่แล้ว

    Amazing tutorial! Very understandable, great explanations.

  • @omerahmaad
    @omerahmaad 4 ปีที่แล้ว +1

    Wow Amazing

  • @goobloob2196
    @goobloob2196 5 ปีที่แล้ว +23

    heytherehowsitigoingeverybody

  • @vikramsingh-xz8ok
    @vikramsingh-xz8ok 4 ปีที่แล้ว +2

    This is one of the best tutorial I have ever been enrolled.
    I have just one question. After the Blueprint section, now if go to terminal after typing python. I am getting issue while connecting to the database from the command line. I am typing "from flaskblog import db". then I am not able to get in or query anything.

    • @juanantonioromerocastillo7269
      @juanantonioromerocastillo7269 3 ปีที่แล้ว

      Were you able to solve this I am having the same issue

    • @11irishjs51
      @11irishjs51 3 ปีที่แล้ว

      See J Town's comment. He says:
      >>> from flaskblog import create_app
      >>> from flaskblog._init_ import db
      >>> from flaskblog.models import current_app, User, Post
      >>> app = create_app()
      >>> app.app_context().push()
      >>> print (app)
      # Now you can run queries against your database.
      >>> User.query.all()
      >>> Post.query.all()

  • @ronaldsalili2236
    @ronaldsalili2236 3 ปีที่แล้ว +1

    I came from django and want to learn flask, however, in this episode I wanted to go back to Django. Huhuhuh

  • @abdulhamidkhorajiya2256
    @abdulhamidkhorajiya2256 5 ปีที่แล้ว +1

    excellent videos. love you sir

  • @youseffau
    @youseffau 5 ปีที่แล้ว +1

    Thanks, Corey for this amazing course. Could you advise how to use Sublime Text 3 to open the bash profile or how to open it manually. I've looked online everywhere and it seems overly complicated.

  • @marcelobarros5073
    @marcelobarros5073 4 ปีที่แล้ว +3

    This tutorial is great.
    Flask's Blueprint is not.
    Blueprint in Flask is manual labor with A LOT of traps. You will expend days trying to find out what went wrong with your application when you decide to convert it to blueprint.
    I almost gave up on Flask when reached that step of coverting my application to blueprint. I didn't do so just because I already had too much work done in it.
    Those Flask tutoriais should start with blueprints from step one, so people wouldn't go through hell like I did.

  • @chrish9803
    @chrish9803 6 ปีที่แล้ว

    I have really been enjoying this exercise and learning a lot along the way, so a big thank you!
    I have a question though. After the project has been restructured how and where would you place code to deal with initialising/creating the database?

  • @jorjolandes
    @jorjolandes 6 ปีที่แล้ว +2

    Hello Corey, great tutorial!! I have a question, in which order the files are executed when we execute the command "python run.py"? (the main ones)

  • @ultiumlabs4899
    @ultiumlabs4899 6 ปีที่แล้ว

    great tutorial, Corey. it gives a lot of new insights, Thank you very much. and are waiting for the unit testing video ^_^

  • @gautamgupte9309
    @gautamgupte9309 ปีที่แล้ว

    Hi Corey, Can you please make a video on the unit testing as promised. And thank you for all your videos.

  • @Ik-Tha-Gamer
    @Ik-Tha-Gamer 2 ปีที่แล้ว +1

    nice