Question

Host a Django Angular PWA

I have already created an App using Django for my client. Now, I wish to separate the backend and frontend. Backend will be Django Rest Framework, and the frontend will be Angular 12. How will I host this on the same app? I can only find tutorials for one or the other, but not both.


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hey there!

You should be able to create the Angular frontend as a static site component within your application. You would then build the Django application as a webservice component within your application. The Django app would need to be configured to use a different route such as /api You could then reach the Angular frontend on / and the Django app on /api.

Unfortunately there isn’t a specific guide currently to cover both of these, but I’d recommend adding that as an idea here.

Hope it helps! Nate