I have used django for few projects and used heroku to deploy. I have been looking into front-end frameworks such as Ember, Angular and was confused as to how it will integrate with a django project. Reading some Docs, it appears i need to have developed a REST api for my app using the backend framework in order for Javascript framework to communicate with the database. In this case the backend mostly works as a thin layer that provides access to the database. But what if I use something like parse and their Javascript API, would I even need a Backend Framework like Django?

1

There are 1 answers

0
Erik Honn On

How frameworks like Django will work with frameworks like Angular or Ember depends a lot on what you want to do with it and what your view on architecture is in general, so it's hard to give a one true answer. But in general no, you don't need one, but you still might want one.

You don't need one because as you surmised frameworks like this want a REST API (although it doesn't have to be specifically REST-like that is definitely the most common way of doing it), so you wouldn't be using Django templating or anything like that.

But one of the good part of using these frameworks, and the part that makes the question impossibly to answer, is that they don't care about the backend!


Why does this matter?

When backend and frontend is properly separated you get a great deal more flexibility on both ends. As long as they work with the API you can build them however you see fit. If you find Djangos ORM nice to work with you can use it to create the API. If you feel like using something super lightweight like Flask you can do that. If you want to host a Java app on AWS you can do that, etc, etc.

The key is that you can let your backend needs determine how you build the backend, and your frontend needs determine how you build the frontend. That's why the question can't be answered. You strictly speaking don't need Django or any smilar framework but depending on what the backend is going to do you might want some of the features from them, like the ORM or the general structure.

So look at what your backend needs to do in order to serve the API and choose based on that.