3 ms·
Can you give a more concrete example? I have a fairly complex app in Django and it is in no way limited. What magic does flask let you do that you cant in djang
by brianwawok 9y ago
Can you give a more concrete example? I have a fairly complex app in Django and it is in no way limited. What magic does flask let you do that you cant in django?
- dheera 9y ago- Using a graph database such as Neo4j is a mess with Django and you can't make use of Django's ORM - Using something that's not a database (e.g. ElasticSearch) and where you prefer speed over ACIDity also sucks because you probably don't want to use an ORM. - Django's stubbornly-rigid MVC model sucks for building reactive web apps. - If your structure is an API back-end that serves up JSON, and static JavaScript front-end that makes API calls to access data as needed, with appropriate API call restrictions, caching, and so forth, Flask is much more suited to this task. Doing this in Django just feels like you're swimming upstream the whole way. Django's ORM is also inefficient if you're dealing with a lot of data and only want to serve a small subset of it. Yes, there have been improvements on all of these fronts with various Django projects, but a lot of the time Flask just gets the job done easier without the bloat.
- ishi 9y agoI agree that if your server is just serving a JSON API, you're probably not using 90% of Django's capabilities. So you might as well use Flask instead. But as for non-relational databases or other external systems, Django does not help you nor hinder you in any way. If you want to connect to, say, Redis - the code would look the same under Django and under Flask. You simply don't use the ORM for those things, since it's irrelevant. You use the appropriate client library for connecting to the external system.
- collyw 9y agoORM stands for Object Relational Manager. I wouldn't expect to use a graph database with it. Its possible to use Django without the ORM, and is in no way required. Haystack integrates Django with Elasticsearch.
- Daishiman 9y agoI have to say that Django-rest-framework's features blow Flask out of the water in terms of building maintainable, reusable REST enpoints.