Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices For Django Web App + REST API Architecture as one project

I am working on my Django project which is going to be a Web App and REST Api for the mobile app.

I am using Django Rest Framework to build the API for the mobile app and it is going pretty good. I like it. For this part, I have a separate app within my Django project. Let's call it 'api'.

What I also want to do, is a web app. Let's call it 'webapp' in my Django project. So basically, web version of the mobile app, with a few different functionalities (e.g. different user/account management) for a slightly different part of the audience. Obviously, the majority of the models that I need, as well as logic are already there in the 'api' app. Also, I want to use Angularjs for the front end of the web app.

My question is what is the best path to take here? Should I create a separate app for my web app and copy the majority of views.py logic, which again will reference models and serializers from the 'api' app in the project? Or should I adjust my existing 'api' app to handle requests from both mobile phones and web app? Thank you.

like image 393
chabislav Avatar asked Sep 10 '25 23:09

chabislav


1 Answers

You can follow link. I also follow that link when started angularjs, django and django-reset-framework.

like image 91
Devansh Avatar answered Sep 13 '25 12:09

Devansh