1
votes

I am very new to Django Rest Framework (DRF) and AngularJs. What I wandering here is the best way to work with these two.

  1. DRF and AngularJs together (Most of tutorials showed me this) in one project
  2. DRF as backend and AngularJs in frontend as 2 different projects

I am very confused, though I feel the 2nd approach is better. But still not sure. Can please anyone help me in this with pros and cons of both the approaches.

1
If you use two separate project or at least 2 apps, has the benefit of separating your service views (provides data) and ordinary views (provides resources: renders content) - Serjik

1 Answers

0
votes

I think the second one is better. In a restful-style project, front-end code is completely decouple with the back-end code.

Besides, separate them into two projects is good for deployment. If you want to upgrade the front-end code, just upload them and restart nginx, front-end code totally is static.