Python Framework Django vs Flask

Question:

I was working on web application with PHP and developed a MVC model by myself. Now due to some reason we are shifting to python.
I have some experience with Django framework. But Now with my new web application I want to develop it in python and I will design my own MVC model in it.
I am not sure that I will be able to do it python So, can you guys help me with some knowledge.

  1. Can I use python to create my own MVC model without Django and Flask?
  2. Will it be feasible and good option to create my own MVC and not using Django or Flask?
Asked By: Compsci_guy

||

Answers:

Can I use python to create my own MVC model without Django and Flask?

Yes obviously you can!

Will it be feasible and good option to create my own MVC and not using Django or Flask?

No. Talking about Django in particular. Some of its awesome features are that it is:

Ridiculously fast.
Django was designed to help developers take applications from concept to completion as quickly as possible.

Reassuringly secure.
Django takes security seriously and helps developers avoid many common security mistakes.

Exceedingly scalable.
Some of the busiest sites on the Web leverage Django’s ability to quickly and flexibly scale

And for you to achieve the same would definitely take a long time. Moreover when you already have something ready-made for you, why to start from scratch?
I would suggest you to go with the already present frameworks (if your sole motive is to complete your web application
). I am sure that Django already has all the features that you will need in your web app.

Answered By: paradocslover

Can I use python to create my own MVC model without Django and Flask?

Short answer: YES!

Explanation: As Django and Flask web frameworks are built using Python, Sure You can build your own MVC model, but it requires a lot of understanding of how Model-View-Controller(MVC) works.

Will it be feasible and good option to create my own MVC and not using Django or Flask?

Short answer: NO!

Explanation: Unless you are not completely satisfied with the Django/Flask model and your project requires additional features which are not present in existing frameworks, it would be a better idea if you use existing frameworks because existing web frameworks solve the majority of the problems and are efficient in execution, scalable and simple to use and understand.

Answered By: Nikhil MVS

paradocslover appart from answering the OP’s questions mentions a couple of interesting Django’s advantages.

So, to take that a step further, people arriving here may find bellow a table of important features provided out-of-the-box for each of the 2 frameworks.

Baseline built-in provided features

Built-in Features Django Flask
Security
database ORM
database migrations
DRY ✓ (model->serializer/form->view->template with a single source of truth – the model – and minimal code) self-coded flow (CBVs provided)
testing requires pytest
rest api + rest docs (openAPI) ✗ (build manually) (easy to generate directly from swagger.io)
templates Django Template Language requires jinja2 installation
async support not that good easy and efficient
Answered By: Gr3at
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.