Open-event-server: refactor: flask vs django

Created on 15 Apr 2016  Â·  15Comments  Â·  Source: fossasia/open-event-server

Before we go forward, there is a request from @rafalkowalski to rewrite everything in django. Should we stick with flask and refactor, or should we restart with django?

@leto @mariobehling please provide your thoughts.

question

Most helpful comment

If anyone is considering rewriting, I can suggest node.js over either
django or flask. Simply because it is like 20x more easy to implement
things like ACL and Oauth on nodejs, vis a vis Python (either Flask or
Django).

I was intending to try it out myself. Not part of GSoC or anything, as a
personal project, to rewrite orga server in Nodejs, and when it is
functionally comparable with current version, to present to you guys.

On 15 April 2016 at 22:37, Avi Aryan [email protected] wrote:

Though I prefer Django over Flask but in this case, since the project is
up and running in Flask without any shortcomings, there is no need to
switch to Django, atleast now when we have an event in hand.
But the Django admin panel and permissions are awesome and if I had to
start this project from scratch, I would have preferred Django over Flask.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/fossasia/open-event-orga-server/issues/253#issuecomment-210549311

All 15 comments

Where is this request from @rafalkowalski ? Rewriting our entire app in django at this point does not seem productive. Let's focus on actually running a conference and getting users.

Agreed @leto. Writing the entire app doesn't sound very productive. Anyways what's wrong with Flask @rafalkowalski?

I too agree with @leto . Moreover I think the present focus should be on developing a test suit.

It seems that django might be easier to roll out features faster. Is there any recommended guidance for the following:

  • flask with rest api
  • flask with angular front-end
  • flask with ACL out of the box
  • flask with some sort of ORM with sql and nosql support

@leto @mananwason What are your thoughts? Is flask just as easy and powerful as django?

@leto request is from @rafalkowalski GSOC proposal.

@juslee sorry but what kind of guidance are you looking for. In general, I agree that django will be easier to roll out features faster plus it has a lot of tools and extensions which flask doesn't seem to have, Flask is kinda limited but right now I think that we aren't facing any issues or limitations with Flask, so we can continue with it. Making the entire thing in django will take a lot of time and effort. So, I am not sure that it will be worth it 😕

We have the beginnings of a rest api already and flask has plenty of libraries related to that.

Why do we need an angular frontend? Also, a simple search returns various people and projects using flask and angular.

Not sure what you mean by "ACL out of the box".

We use sqlalchemy as an ORM and currently don't use anything "nosql"-ish. And never in my experience have I used an ORM for a noSQL database.

Ok. Got it. Let's hear from @rafalkowalski.

I'm satisfied with justifications to continue working with flask.

I'm looking for a bootstrap admin dashboard theme right now. Just exploring possibilities right now. Whether if angular could actually help speed up creating the admin dashboard.

For REST API, I'm thinking flask-restplus. Thoughts?

Agreed. We do not face any limitations from flask, so there shouldn't be a need to move to Django. But the Admin Panel that Django ships with can really reduce our load to design views. Views for the admin won't be needed as dj already comes with a panel written in django templates. The Django Auth package comes with built-in user permission system, that we can alter to include speaker etc. tbh I think we can create a django OE organizer server faster than refactoring the current flask code. May be that's what rafalkowalski meant?

But then we will need a separate django app to handle APIs (DRF can solve this easily though).

I don't think we need to change our web framework. Flask seems to be good enough for our needs.

Instead, We could go for an API-Centric approach. The API could be made the only interface for an read/write operations on the data. The user interface would communicate with the server via AJAX API calls.

An API-Centric Web Application is a web application that basically executes most, if not, all its functionality through API calls.

What should be done if we're going ahead with this ?
  1. We'll have to build a comprehensive RESTful API for all actions.
  2. The front-end could use a lightweight javascript framework to make it easier to develop and maintain. I was thinking Vue.js along with webpack to maintain, minify and serve assets.
  3. Implement a proper test suit covering all aspects of the API. As the front-end would also be depending on it.
  4. Implement an authentication system. (If using OAuth 2.0, the front-end could use resource-owner password grant to authenticate itself with the API). The user's access levels could be handled by assigning proper scopes.

@juslee I agree with others. Most of the things such as RESTful API and stuff can be done in Flask as well. And I dont see any need of Angular JS for its front end. Simple Material Design should do I think.

Though I prefer Django over Flask but in this case, since the project is up and running in Flask without any shortcomings, there is no need to switch to Django, atleast now when we have an event in hand.
But the Django admin panel and permissions are awesome and if I had to start this project from scratch, I would have preferred Django over Flask.

If anyone is considering rewriting, I can suggest node.js over either
django or flask. Simply because it is like 20x more easy to implement
things like ACL and Oauth on nodejs, vis a vis Python (either Flask or
Django).

I was intending to try it out myself. Not part of GSoC or anything, as a
personal project, to rewrite orga server in Nodejs, and when it is
functionally comparable with current version, to present to you guys.

On 15 April 2016 at 22:37, Avi Aryan [email protected] wrote:

Though I prefer Django over Flask but in this case, since the project is
up and running in Flask without any shortcomings, there is no need to
switch to Django, atleast now when we have an event in hand.
But the Django admin panel and permissions are awesome and if I had to
start this project from scratch, I would have preferred Django over Flask.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/fossasia/open-event-orga-server/issues/253#issuecomment-210549311

@championswimmer Seriously I have also been tinkering with Node.js for some personal projects and it's awesome in terms of not only ease of writing code but also because of all the support that is available for it. And yeah it's also asynchronous !! 😉 If we plan to write the server again, Node.js will be the best option.

@championswimmer +1 for Node.js... It's truly amazing... Got tons of frameworks and packages. And the development environment plays well with the client-side javascript libraries too. Would be a good alternative to consider instead of python.

Decided to continue using flask, and refactor using flask-boost, flask-restplus.

Was this page helpful?
0 / 5 - 0 ratings