user8106849
user8106849

Reputation: 60

Angular django rest framework integration

How to serve angular using Django server? I don't want to host two different server for angular and Django. How to do it with a single django server? I have developed frontend application using angular 6 and backend using DRF. I am running django server in the back end and using ng serve command to run angular application.

Upvotes: 0

Views: 444

Answers (1)

Toan Quoc Ho
Toan Quoc Ho

Reputation: 3378

To achieve this, you should serve your Angular project in production mode. This is a must have if you seriously deploy your project to the world, Angular will optimize the bundle to make UX better than on development mode.

And also for Django project, you should deploy it using gunicorn or uwsgi and using nginx as a reverse proxy (reference this gist) for your application.

Hope that helps!

Upvotes: 1

Related Questions