Blog Post #2 – Learning About Django

Last week I wrote about how one of my goals for the capstone project is to learn a new technology. I suggested to my team that we use Django. I am motivated to learn Django because the job I will be starting in May uses it and last week I started a Django tutorial.

I have used Python for several projects, but I used Flask to create the backend. Now that I am learning Django, it is interesting to compare the differences between a larger more comprehensive technology like Django and a smaller framework like Flask.

Overall, Django seems to make many tasks easier. I have an appreciation for Flask because without learning how to perform functions the hard way with Flask, I wouldn’t understand exactly what was happening when I use the Django built in functions. This explains why we were not allowed to use Django for course projects in Intro to Databases and Cloud Application Development. By creating a database abstraction layer and API from scratch using Python and Flask, I gained a greater understanding of how a back-end works and the code that is needed to get a simple site or app up and running. This process also gave me an appreciation of the complexity behind a full-stack web framework like Django.

I am still in the process of learning Django, but so far these are some of the differences I have noticed and learned about. Django is considered a full-stack web framework whereas Flask is a micro web framework. Flask does not have a database abstraction layer, form validation, or other built-in components, but there are many third-party libraries that do provide these common functions. Django has these functions built in which I think is really exciting for this project because it will allow more time to create functional website components.

One direct comparison that I found interesting was in creating a website form. For my CS340 database project, we used a third-party library with Flask to create forms for the website. Django has a forms component built in. I learned how to use the Django forms feature in a fraction of the time it took me to learn and integrate the Flask third party forms library. Overall, both were easy to use and learn, but Django really does excel at allowing the developer to get up and running quickly. One similarity is they both use a templating system; the Django templating system is built in, and Flask uses Jinja2. Interestingly, I read that Jinja2 is based on Django’s templating system.

Overall, Django and Flask each have their own benefits and I still have a lot to learn about both. Next, I am going to learn about Django’s rest framework.

Leave a comment

Your email address will not be published. Required fields are marked *