GnahzNiX
GnahzNiX

Reputation: 93

Django Rest Framework + Angular 2

I new to the web development.

Right now, I am using Angular 2 as front-end and Django-Rest-framework as back-end. While browsing the tutorials online, people often build the angular2 app (ng build) and then place those built files under the django project. But my question is, doesn't this approach defeat the purpose of decoupling? Can you provide me the pros and cons of these two approaches?

  1. Ask Django to host the built angular project, and deploy it as one instance.
  2. Separate both frontend and backend, and deploy them as two instances.

Thanks in advance.

Upvotes: 0

Views: 325

Answers (1)

Wolfgang1478
Wolfgang1478

Reputation: 46

I don't see a reason to host an Angular app inside a Django project, most apps will separate frontend from backend and deploy them to different servers (at least in my experience) to ensure easier maintenance, that way if your backend has any bugs, you'll have an easier time finding where the bug is and how to fix it.

Mixing both would mean that if for some reason front or backend have any problem, THE WHOLE app will have said problem and result in a bad user experience.

Upvotes: 2

Related Questions