PyBelfast - Comparison between Django and Flask
Rebecca Martin, PyBelfast @laches1sm
So wtf am I talking/slabbering about now?
- Do you really want to know?
- Yes?
- Oh no
- Comparing Flask with Django
- At least there might be parrots?
- Yes?
What even is Django and Flask?
- Both are web frameworks compiled in Python, used for building web applications, APIs, etc....
- Flask is a microframework, Django is simply a framework
Flask / Django
- Differing aims - Flask aims to 'keep the core simple but extensible'
- Django - more about encouraging rapid development
Flask / Django
- Flask is based on WSGI - so needs a central callable object that is the implementation of the application
- Gives several advantages:
- Subclassing
- Reflection of information
- 'Explicit is better than implicit'
Flask / Django
- Django is more based on the MVC principle:
- ORM --> Data model --> View --> Controller
- Django does most of the work for you
- Less customisable than Flask
Flask / Django - Routing
- Flask - Werkzeug
- Django - URL dispatcher/URL Conf
Flask / Django - Templates
- Flask - Only one template - Jinga2
- Django - Can use many - default is Django Template language
Flask / Django - Best situation
- Flask is great if you want to customise anything and everything
- Django - has most everything bundled with it - a great Python web framework for beginners
Flask / Django - General Differences
- Flask is built on customisability - can be extended
- Django is built to take care of most web development concerns
Flask / Django - Any questions
deck
By laches1sm
deck
- 613