Deploying React - django apps on Azure web apps - python

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:
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
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

Related

How we can deploy a Flask + React Application to Azure?

I want to create a machine learning app with Flask as backend and keep React JS as the front-end. Though I found couple of tutorials how to do that but there are very few in terms of deployment. I want to deploy and host a Flask+ReactJS app to Azure cloud. Is there any good tutorial or link which I can follow. I have been struggling for days now.
Thanks
To achieve the above requirement you can find the below mentioned sample resource to create and host flask and react app in AZURE.
To do that we will need to setup the flask app as backend and then React app.
Please refer this BLOG for complete setup to build.
For more information you can refer the below links:-
SO THREAD: How to deploy a Flask+React application to Azure Web Service
BLOG:- Deploy your Flask app on Azure & How to automate Python/Flask deployment to Azure App Service

Can we manage the deployment of each django app within a single Django project independently?

Lets say we have one django project that has two apps - FooApp & BarApp.
Each app talks to its own database. Meaning they both manage their own set of models. Is it possible to manage the deployments of these apps independently? It's okay for them to be deployed on same server within the same nginx process as long as I am able to make changes to the apps without bringing down the other as well.
I understand that these can very well be separate projects and they can communicate with each other using RESTful APIs. For my needs, I want to avoid that REST interaction for the time being.
The django documentation [here][1] describes a django project and django app as follows
Django project:
The term project describes a Django web application.
Django App:
The term application describes a Python package that provides some set
of features.
So if the app is simply a python package, and the django project is really the one that defines how these apps are managed via the settings module, then I suppose there is no straight forward way of accomplishing what I want. Or is there anything I can do?
TIA
[1]: https://docs.djangoproject.com/en/dev/ref/applications/

How to Integrate Django WEB Application with Microsoft Azure For Authentication

I have developed a web application based on Django Framework, but i want my application to get authenticated by Azure Single Sign on, Please suggest the method or tutorials to achieve this
Google django azure authentication leads to here leads to here
Documentation here

Deploying app with python backend and Angular frontend on GAE

For a college project, I'm developing a RESTful API. The API has been coded in python and deployed with the Google App Engine (which works fine).
I've developped an Angular (5) application as the frontend which makes HTTP requests to that API.
The question is - how do I deploy both backend and frontend on the same Google App Engine project? Am I supposed to merge both directories (python and Angular apps) and deploy the whole thing directly?

Integrating Ember CLI with Django app

Before Ember CLI, I use to create an index.html page within Django project, plus the App.js file and all seemed to be working great.
Now that Ember is using CLI, it seems that there is no easy way to integrate Ember CLI project within Django application.
So I read that people are recommending using Ember CLI to develop the front-end, and Django to develop the REST API. However deployment is not easy, because you need to copy the Ember dist folder under Django static folder, plus change all the static asset url under Ember app to point to Django static path.
So it seems that, there is no easy way to integrate the two into one single development process.
Do you guys, have any suggestions on how to integrate the development, and deployment process?
Thx.
For projects like this, you should use separate repositories for your server app and client app(s).
Consider a project that has 4 code repositories, 1 server and 3 clients:
myproject (A Django app written in Python that provides an API for clients)
myproject-web (The Ember.js web client written in JavaScript)
myproject-ios (An iOS client app written in Swift)
myproject-android (An Android client app written in Java)
The core app will be deployed to a server that is capable of hosting Python apps (e.g. uWSGI).
Because the Ember.js project is ultimately a static resource, you can serve it from pretty much anywhere (e.g. NGINX), and point it at a separate API server that hosts the Django project (e.g. https://app.myproject.com/api/). See documentation on configuring ember-django-adapter to use a custom API host: http://dustinfarris.com/ember-django-adapter/configuring/
iOS of course would be deployed to the Apple App Store, and the Android project would be deployed to Google Play.
Each repository is a separate codebase with different requirements and deployment strategies—which is why it is best to keep them separate, so you can think about them and work with them in isolation. Just because Django can handle static assets doesn't mean you should rely on it—trying to host an Ember.js project (or any other JS framework project) within a Django project is just overcomplicating things. Hope that helps.
I am currently implementing a Ember-CLI app served by Django.
Here are the steps that I followed:
On Django:
Create a sub-project in your django project (ie: ember)
Install django-redis-views that will serve your index.html from redis.
Create a S3 bucket + CDN on AWS (or other storage product) in order to store your assets
On Ember:
install ember-deploy-redis & ember-deploy-s3
Add credentials to config.deployment and correct fingerprint in your ember-cli-build.js
Deploy ember
Useful link:
Easy deployment using redis + CDN: http://ember-cli.github.io/ember-cli-deploy/
Pip package that help your retrieving your index.html stored on redis: https://github.com/kevinlondon/django-redis-views

Categories

Resources