Practical Guide to Python

Python Web Frameworks

Practical Guide to Python

Check out a free preview of the full Practical Guide to Python course

The "Python Web Frameworks" Lesson is part of the full, Practical Guide to Python course featured in this preview video. Here's what you'd learn in this lesson:

Nina introduces the Django and Flask frameworks for Python. Django includes a lot of features out of the box like ORM, user authentication, and content management. Flask allows users to create basic backend APIs easily, but requires third-party packages to extend beyond this basic functionality.

Preview
Close

Transcript from the "Python Web Frameworks" Lesson

[00:00:00]
>> All right, this is it, it's the final countdown, the final stretch we're gonna talk about web frameworks in Python. And then you are going to be a verified Python Pro with this stamp of approval for me personally. So hopefully you're ready, or we're going to use some of the concepts that we learned earlier on to work with a more advanced framework called Django.

[00:00:29]
Now, what are web frameworks? Well, web frameworks are designed to support creating applications for the web. While simplifying and also extracting away a lot of what happens under the hood. So they're gonna provide you with the plumbing so that you can focus on just building your application. There are two really popular web frameworks in Python, one is Django.

[00:00:55]
Django is fully featured, it's a high level framework for building web apps, and it focuses on automating and providing as much as possible. Many large scale sites like Instagram, do run on Django, and because Django provides a lot out of the box. It's considered to be quite an opinionated framework, Django builds itself as the web framework for perfectionists with deadlines.

[00:01:23]
There's quite a bit that's included in Django, there's a database ORM, which is an object relational model. To make working with databases as simple as working with Python instances. There is easy to build upon admin backend interface that makes it easy to manage your content with nice forms with validation and teaming.

[00:01:48]
There is built in user authentication, there's a template language there's protection against common security vulnerabilities and a lot more. And you're probably thinking, well, this all sounds great and it is great until you find yourself needing to do something. That doesn't really fit in the Django paradigm, and that's one thing start to get complex.

[00:02:11]
To contrast Django, there's another popular framework in Python for the web called Flask. And I would say that Django and Flask share equal popularity, Flask builds itself as a micro framework for Python. It makes it really easy to make basic backend API's and web apps with a lot less code, and a lot less configuration.

[00:02:35]
I think Flask is easier for beginners to understand and setup and it's a lot less opinionated. The drawback is, if you want to start adding some of these additional components to your app like databases, authentication and other layers. You're gonna need to use plug ins or third party packages because it doesn't provide a lot of these for you out of the box.

[00:02:56]
If you are not into Flask or Django, you can find a long list of Python Web frameworks at the link here. And for front end integrations with Python, you're not required to use the templating that's built into either Django or Flask. Both frameworks work very well when they're paired with modern front end technologies like react, Angular, and view.

[00:03:20]
And you can learn a lot about those other frameworks on frontend masters.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now