Reputation:
At the moment I have a project where the backend is running in Flask + redis and the frontend is angularjs. The backend serves jsons and angularjs takes them to fill its templates.
Django has a bunch of features that I would be very interested in using (namely, admin and logging - I don't want to write that, it's boring). But Django also has a templating engine etc, it's the whole package.
I would like to know about the viability of using Django exclusively for the backend serving jsons (except admin, obviously). Is this a good idea, or does it have any obvious flaws?
Thanks.
Upvotes: 2
Views: 4779
Reputation: 9476
It's perfectly viable to use Django for the back end for your site. I've done so myself with great success when I used it as the back end for a Phonegap app that used Backbone.
Tastypie is very good for creating an API - it's pretty easy to use, and consistent with the way Django works. I had a very good experience using it and can highly recommend it - it felt very similar to using Django's generic views. It also has excellent documentation, and can easily handle things like authentication for you.
There's also Django REST framework, but I haven't used this myself, so I can't tell you whether it's better or worse than Tastypie.
Regarding redis, if you want to use that for caching, Django doesn't include support for that out of the box, but the caching backends are made to be easily swappable and django-redis is available for using redis as a cache.
Upvotes: 1