Django Vs Flask

Tyler Holland
3 min readMar 4, 2020

Django and Flask are both great platforms for creating awesome projects, but they have a lot of different functionality.

Django

Django

To start a Django project you need to run a specific line of code and another line of code to start the individual apps. When you create the initial project, Django gives you a preset folder titled settings.py. This file comes with everything built-in and doesn’t require any major changes for a simple Django project. This file contains things such as, the time zone in which your project is being displayed and it also contains every additional application that you create.

Django allows you to be able to create a project fast and efficiently to the point where you can master the basic command lines to be able to create a minimal project within an hour's time. This is possible due to most files being built in when you are creating your project apps. There is only one major file that is not already given to you. The file that is not included is a urls.py file that will route the application to the proper page that is being called upon. The files that are included are a models.py file that contains the functionality of the app where you can create everything that is being stored in the database. Yes, Django comes with a built-in database! There is a views.py file where you are creating the functionality of the models.py file. These three files are the main portions of a Django project because this is where a large portion of the user information is being stored. These files also allow the user to have some sort of visualization of what your project looks like. Django’s built-in functions make the process to create a project efficiently and fast.

https://www.edgica.com/django-logo-big/
Flask

Flask

Flask is a lot less tedious than Django is. As in, you will not have to override the functionality of the framework to get things to look and do what you want them to do. Flask requires a lot more attention to detail and a lot of manual coding. There are no command lines to run that will make everything neat and organized. Everything must be built out and have a proper layout in order for the project to be built in a professional manner. Flask requires you to build-out your own crud functionality and requires you to create your own authentication and authorization. Django saves you the time by building all of these out for you. You do not have to stress to figure out what works with what in Django because most things are already given to you.

Which is Better to Use?

The better option to use is completely based on your confidence level when it comes to web security and setting up your project. If you are a person who likes to build everything out from scratch and likes to know what all of your code is doing, then Flask is the way to go. Flask requires more knowledge on how to set up your files and how to properly instantiate your classes. While id you’re a person who enjoys having a template or guide to get you started with a project, then Django would be the way to go just because it allows you to have some sort of nudge in the right direction when starting because it has most of the files necessary to finish a project.

--

--