I'm wondering, if it is a good idea to build a single page app (e.g., with ReactJS or Angular 2.0) with Django as backend. What's experience? What stack would you recommend, assuming we are staying in Python backend-wise?. Thanks!
I feel like that is a matter of personal taste and what your data sources are behind it. Flask makes it easier to do whatever you want, but you also have to do many things by hand, where Django has an included "right" way of doing them.
I've spent a lot of time working with Django as a backend and AngularJS powering the client. It's definitely not a bad combination.
That said, in my personal projects, I lean towards letting Django handle almost all of the client experience too. There are exceptions for areas that are inherently interactive (e.g. WSYIWYG editor), but the vast majority of my projects involve static content. To me, the complexity and overhead of using a JS library/framework outweighs any benefits the library/framework might offer.
I have worked with DRF in the past. It is a very nice framework. However, I came to believe that it is too low-level for new projects. Do you really want to handle at least the following pieces of boilerplate for every API or endpoint?
- Request parsing
- Content negotiation
- Creating/rendering responses
- Subclassing or decorating custom views and/or viewsets
- Model mixins, CRUD glue
- Routing
- Content-type parsing and rendering
- Serialization/deserialization
- Validation
- Authentication
- Filtering
- Pagination
Personally, I found it was harder to get from zero to anything when having to slog through that level of verbosity. I'd rather save brain cycles for harder problems.
It was this experience on the job that led to the design of a better approach with Ramses: http://ramses.tech. You can also generate docs, tests and client libraries this way. If you like the look of that, I will make you an end-to-end prototype for free to help drive home the concept.
Depending on how complicated your API is, you may not need something as heavy as Django. This is a neat little framework if your backend doesn't need to heavyweight:
It seems popular still. Do you want a batteries included python web framework? Can't do much better.
In your case, a SPA is not using a lot of Django stuff. So do you really like the admin pages and the ORM? If so use it. If you don't need admin pages and you hate the Django ORM, maybe look at just using Flask?
-- Only used Django a few times so not an expert, but above is my gut feel.
Is your app data-driven? If yes, have you considered Ember.js? At my startup, we're using Ember + Ember Data backed by an API built with Django + Django Rest Framework, and we couldn't be happier with the conciseness and elegance of our code.