Let's(Upgrade) LEARN TOGETHER❤️   

Django and Flask

Posted by YOGESH (BEING HUMAN) on MAY 4, 2020

This Article will only give you a overview of Django and Flask Frameworks because to understand in detail, you need to work with those frameworks in programming world.

Source:
Source: Jetbrains.com

Assuming that you are beginner, let us first quickly understand what is a library and framework?

https://www.youtube.com/watch?v=sXA1zpv4DhA

Framework:

framework, or software framework, is a platform for developing software applications. It provides a foundation on which software developers can build programs for a specific platform. A framework may also include code libraries, a compiler, and other programs used in the software development process. (Source: Techterms.com)

When you google about Types of Python Frameworks, you will end up with a list of frameworks which are commonly used but most of the PYTHON programmers prefer Django and Flask.

Django is like a Big-brother of Flask which comes under Full-Stack Framework and Flask is Microframework where “micro” means it aims to keep the core simple but extensible.

Full-Stack

Full-stack frameworks do the heavy lifting of creating Python applications. Unlike the misty dawn of computer languages a few decades ago, today developers can tap the power of frameworks to provide them with libraries, templating engines, and database management. (Source: dzone)

What is Django?

Django

Type – Full-stack framework Django is one of the most beloved web development frameworks for developing Python applications. In fact, it ended up being one of the top 10 web development frameworks of 2020. Django framework follows the DRY (Don’t Repeat Yourself) principle.

Unlike others, the free-to-use and open-source full-stack Python framework include a grand number of built-in features rather than offering them as individual libraries. Django makes use of its ORM for mapping objects to database tables.

This results in allowing the code to work across different databases as well as making it easier to migrate from one database to the other. Though Django has inherent support for MySQL, PostgreSQL, SQLite, and Oracle Database, it can support other databases via third-party drivers.

Key highlights:-

  • A plethora of ready-to-use libraries
  • Authentication support
  • Database schema migrations
  • Object-relational mapper (ORM)
  • Support for web servers
  • Template engine
  • URL routing

Check out the advantages and disadvantages of using the Django framework.

(Source: hackr.io)

Micro-Frameworks

Micro-frameworks are small, easy to understand, and easy to use. They are terse and have simple documentation. URL routing is often RESTfulMicro-frameworks use WSGI and work through HTTP request/response. They are a good choice for small applications, or as part of a larger project. (Source: dzone)

Flask

Type – Microframework Available under the BSD license, Flask is another popular Python framework. Inspired by the Sinatra Ruby framework, the microframework requires Jinja2 template and Werkzeug WSGI toolkit. Thanks to its lightweight and modular design, Flask is readily adaptable.

Flask allows the developers to build a solid web application foundation from where it is possible to use any kind of extensions required. The micro-framework is compatible with Google App Engine.

Key highlights:-

  • Built-in fast debugger
  • HTTP request handling
  • Inbuilt development server
  • Jinja2 templating
  • RESTful request dispatching
  • Support for plugging in any ORM
  • Supports secure cookies to establish client-side sessions
  • Unicode-based
  • Unit testing support
  • WSGI 1.0 compliance

(Source: hacker.io)

Should I go with Django or Flask?

https://youtu.be/asmvv8w8JY0

Django Vs Flask

https://youtu.be/OZ3K4fK9cAQ

For more: