top | item 29837286

(no title)

cessor | 4 years ago

I'd love to hear your criticism of django, issues you encountered and problems you have solved :)

> My real criticism of Django is that, at long last, I think it's starting to look dated.

Actually, that is something I found really great about django. I found that django is reliable over a long period of time. The js/node/react/express/angular apps I had developed in the past (~2012+) can't be built these days without redoing major components. I never had these problems with django.

As for the responsiveness of the results, I found that a good understanding of django's performance helps. Using a good caching strategy (on models, views + nginx) yields results have almost instant reactions, even though there is the whole HTTP to HTML roundtrip. While they do have the noticable page-reload semantics, I found that these are way easier to build and sometimes yield very enjoyable experiences for my users. After all, I'm not building a YouTube so PictureInPicture and SPA-semantics aren't that important to my users.

> Modern web apps are maintaining models in the client and staying current though a combination of ajax queries and websockets.

Julia Elman explains how to do this with Django + DRF and Backbone.js in the book "Lightweight Django" (O'Reilly). Is this a viable compromise?

discuss

order

madrox|4 years ago

I've implemented Django+DRF+React in several projects. The thrust of my arguement is that, were Django started today and not 17 years ago, it would account for these concepts more than templates do.

Django contrib exists to be a home for first party solutions to specific problems [1]. It need not be an entire frontend framework that follows trends like react, but something to make syncing state easier sits squarely in that namespace.

1 https://docs.djangoproject.com/en/4.0/ref/contrib/

jmconfuzeus|4 years ago

If you want to build highly interactive apps with React then you should consider django-graphene instead of DRF. REST wasn't designed for JSON apis.

Nextgrid|4 years ago

One advantage of REST is that it's easier to use from a programmatic client perspective; this might become useful if you want to offer an API to third-parties.