Django to serve JSON: overkill?

34 views
Skip to first unread message

Charley Paulus

unread,
Oct 27, 2018, 9:13:33 AM10/27/18
to Django users
Hi,

Is it overkill to use Django just to dispatch url requests and to reply with JSON (i.e. not using at all the HTML template engine)?

Thanks.

Best regards,
Charley

Babatunde Akinyanmi

unread,
Oct 27, 2018, 9:56:53 AM10/27/18
to django...@googlegroups.com
Not necessarily. It just depends on the exact use case, the direction the application is moving in the future, etc

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/fac5482d-3d6d-4970-8700-61a710026ba5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PASCUAL Eric

unread,
Oct 28, 2018, 5:34:19 AM10/28/18
to Django users

Hi,


If the JSON is related to a data model, and if this model is elaborated and subject to evolution in the furure, Django can help a lot. Add Django RESTFramework to the combo to take care of the REST stuff.


If not, I'd suggest Falcon (https://falconframework.org/), which is a light and very efficient framework made for developing REST based services. I've used it quite a lot for writing micro-services of a complex platform. Services working with data models are developed on top of Django. The other ones are Falcon based.

Extended Test. Falcon was also benchmarked under CPython 3.6 with a more realistic scenario, in which the routing table had multiple entries, the query string contained percent-encoded characters, and several complex response headers were set in the response.
Hope this helps


Eric


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Charley Paulus <charley...@gmail.com>
Sent: Saturday, October 27, 2018 3:13:33 PM
To: Django users
Subject: Django to serve JSON: overkill?
 

Charley Paulus

unread,
Oct 28, 2018, 9:53:04 AM10/28/18
to Django users
Hi Eric,

Yes that helps a lot.
I have data models and related DB.
I’ll go with Django.

Thanks.

Best regards,
Charley

PASCUAL Eric

unread,
Oct 28, 2018, 7:15:41 PM10/28/18
to Django users

Hi Charley,


You should not regret this choice.

Sometimes Django seems a bit overkill at the first glance. But most of the times, once the project has made some progress you'll quickly appreciate the fact it is like Python : batteries included. No need to hunt for external add-ons which will integrate more or less easily when it comes to take care of CORS, CSRF, sessions, I18N,... All is already here for free. I could verify this on a Flask based project : you're left alone when time comes for you to find the right LEGO blocks and make then fit together. Django creators have already made this for you, and they're very smart people.


And of course the default Django configuration can be optimized by removing middlewares and features you don't need to cut it down to the strict necessary. So, why bother ?


Regards


Eric


Sent: Sunday, October 28, 2018 2:53:04 PM
To: Django users
Subject: Re: Django to serve JSON: overkill?
 
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Vineet Kothari

unread,
Oct 28, 2018, 7:22:49 PM10/28/18
to django...@googlegroups.com
You can use falcon/flask if you only want to create api as these are minimalistic frameworks and very easy to understand

Reply all
Reply to author
Forward
0 new messages