Python Flask Tutorial: Full-Featured Web App Part 5 - Package Structure

preview_player
Показать описание
In this Python Flask Tutorial, we will be learning how to restructure our application into a package rather than running from a single module. This has major benefits in terms of importing modules across our application. Let's get started...

The code for this series can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

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

Watching your tutorials is not just learning. It's more like a thrilling experience. I've never met a person with an ability to explain such complicated things in such a logical and comprehensive way. You're exceptional...

kobas
Автор

Anyone watching in 2020? This series is so helpful man, especially for a high school student.

bensonjin
Автор

Many Years later, this training is still helping people grow. Thanks Corey.

ziyaetuk
Автор

This is just life saving. I have been struggling with circular imports on flask for the entire weekend. Funny fact, almost no one is talking about this, and surely no one is doing so as thoroughly and crystal clear as you do. Thanks so much Corey. Finally was able to get this solved. Time to build models!

tallsamurai
Автор

I don't know how many times I said to myself "Ahaa, never fully understood this before" while watching your Python videos. Even after a year or so dealing with Python, I always come back to some of the videos and extract something new and valuable.

nikolak.
Автор

6 years later, and still the best explanation of circular imports I've ever seen. Thank you for your work Corey. It is much appreciated even after all these years.

ubzxsyn
Автор

Thanks for taking time to explain the import errors! wasted 2 days searching for the right approach.

gauravpurohit
Автор

Your explanation of the circular imports made more sense than anything I've tried to understand so far!!!

PmanProductions
Автор

This video is a fair justification of knowledge never dies. I have been searching for this in a lot of documentations and all, but the explaination and justification in this video is so on point. Thanks a lot Corey. You are amazing

TanjeetSarkar
Автор

I absolutely LOVE this series. These are the kind of tutorials that I have always wanted, and now I have found them. Well done, Corey. You are awesome!

anadisharma
Автор

Very important video for those who wish to go a long way. Very important for big projects.
Thanks a lot.

shwetasoftware
Автор

That's right, I read from Miguels solution about this; it was horrifically involved, complex and didn't break it down at the right level. Your description and show and tell is absolutely fantastic, a breath of fresh air and no doubt helped the 100k people that have watched this. Thanks so much!

McMurchie
Автор

5:00 Superb explanation! Couldn't understand it better from anyone else. A completely mind-boggling scenario made extremely simple. Corey you are just fantastic!

MrKkfar
Автор

2022 Application context error Windows Solution

I am working on this tutorial 4-1/2 years after its release. I am in a Windows environment with the latest python and flask versions. Because of this I get errors at 18:12 that Corey does not. None of the other solutions in the comments worked for me. What I show below did work.

First I had to hard-code the database_uri line in __init__.py:
=
Change it to match your project folder name.

Then I used these commands in the python shell:
Make sure you delete any pre-existing site.db file in your project folder.

python
>>> from flaskblog import *
>>> app.app_context().push()
>>> from flaskblog import db
>>> from flaskblog.models import User, Post
>>> db.create_all()
>>> db.session.commit()
>>> User.query.all()

Hope this helps someone.

paulbrugger
Автор

Some amazed Russian student here
Your lessons are so cool, nobody in my university can explain something so clear... I'm going to watch all of your tutorials. Thank you so much!

zvcxnlb
Автор

This video helped me so much. As a university student who knew only java, working in python and browsing github was confusing. I did not know how to read code and how the project was structured. This video made it all clear. Thanks Corey!

MistaT
Автор

Tree package in windows - "pip install tree"
View the directory structure by using command "tree /f /a"

satishkumar-wynz
Автор

if you're using vscode and you're unable to move the import statements below the top of the file, its because of a linter automatically reformatting your code. Uninstall or modify your python linter extension you have installed to continue with the tutorial. Thank you Corey, this is the guide I needed

timmytat
Автор

the twist in that error was amazing ❤️‍🔥

_saranyamaity
Автор

Amazing as always... I don't think I would have ever understood the concepts of restructuring the project without your explanation. Thank you Corey!

adamjacob