As a Pythonista, Django is the go-to web framework for me. It’s far from sexy, but that doesn’t matter. Django’s catchphrase is accurate: “The web framework for perfectionists with deadlines”.

The batteries-included approach that Django takes, similar to Ruby on Rails, makes it an incredibly productive framework. Let’s briefly talk about the standard challenges or choices you will need to implement for any web application.

Standard challenges

  1. How are you going to map your data? Will use an ORM, a SQL builder, or something else entirely?
  2. How are you going to handle database migrations?
  3. How are you going to handle authentication and user management? How do you ensure that your user passwords are stored safely?
  4. How are you going to handle the routing of pages? And form handling?
  5. How are you going to render pages from templates? Or are you going to serve data via an API to a single page application?
  6. How are you going to handle static files?
  7. How are you going to handle logging?
  8. How do you ensure security of your application? How do you prevent clickjacking and CSRF?
  9. How do I schedule background tasks?
  10. How do I add a cache to my application?

If you are opting to create an application without a web framework, you are going to have to handle each of these and more. If you choose to use Express or Flask or similar minimal frameworks you will have to implement most of these.

Django gives you all of this either out-of-the-box or via a popular package. Where there are choices like template rendering vs an API you have Django REST framework and Graphene and many more packages.

Frameworks in general

The whole point of frameworks is to save you from having to reimplement these same sorts of functionalities over and over again. Because of this, using Django puts you in a position where you can focus on your business logic rather than boilerplate code.

At the end of the day, unless you are specifically building something to test out a new language or tool, sticking with the popular frameworks is a good move. Most problems you encounter are well documented. Getting advice and help is possible simply by participating in the community.

I’ve asked many, many questions in the /r/django subreddit, so much so that when I type in Reddit in my search bar it defaults to that sub.

Sure, it isn’t all sunshine and rainbows when you use a heavy framework. There will be times when you get frustrated that you have to do things their way. But honestly, I find that when I feel constrained by the framework, it turns out that I was thinking the wrong way. The chances that my problems are unique and impossible using the framework are super slim.

Write A Comment