简体   繁体   中英

Deploying React - django apps on Azure web apps

Locally, I am able to run my django app and react app. I migrated the django app to the azure web apps. My question is, what is best practice regarding connecting the react app to the django app. Should I start another web app instance, or should I try to run both on the same instance?

The easiest way is that both React and Django are deployed on the same instance, however it depends on your need.

There are many ways to deploy Django + React, I will mentioned only two:

  1. Simple one: Just import react libraries into your Django template and deploy your Django on the instance as a normal Django project. You may refer to this tutorial on how to accomplish this: Add React to Django Template

  2. Second way which I would recommend: Deploy Django and React separately. Django app to be deployed on the Azure instance and react to be deployed as a static website on Azure Blob storage (You may refer to this tutorial: Host React on Azure Blob ). In this case, your react app will be using the Django exposed APIs (through Django DRF). You may refer to this tutorial for further details: Deploy React + Django

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM