Deploy Django API + React app on Heroku - django

I'm developing an web application with React in the front-end and Django API REST in the back-end (mostly because in the future we're gonna create a mobile app). My question is, what is the best way to deploy this web app on heroku? Using two distincts heroku's app (one for React and one for Django), or to use Docker to deploy both app's in one single heroku app? (I've read a little about Docker, but i'm not sure how I would deploy it on heroku)
Thanks and sorry for the English.

A good way is deploying to one app by bundling all your front-end with webpack for example. If you are doing server side rendering probably its better to go for two separate apps.
This tutorial talks about preparing your webpack configuration and this repo shows how to deploy webpack-django heroku app

Related

How to deploy a Django backend and Flutter frontend web app

I've been working on a web application that uses Django REST Framework and Django channels in the backend and has a Flutter frontend. It works successfully when tested locally, but my question was how would I deploy this:
What server is most appropriate for this application? (it should be free as this is just a personal project I've been testing)
Do I need to deploy the frontend and backend separately?
Are there any online resources I can refer to, to help me in this process?
Any help is appreciated :)
If you want to use it only for your personal use you could use https://www.heroku.com/free to host you backend.
You could use this guide
Yes, you should deploy them seperately.
Since in your specific case the django application is only used to hold the data, provide a REST API and sockets.

How Can i use Nuxt and Django for production at the same time?

I have a background in Django and a some experience in Vue. I have used Vue for almost a year now, but since I need an SSR I have to use Nuxt.However, I am still very confused with how to deploy it in the server along with Django. Should I deploy them in the same server or should I deploy them in a different server with Django server for API and Nuxt for the front end?
I have also used Vue alongside Django for a while in my project and I'm looking into Nuxt right now.
I'm planning to migrate my standard Vue codebase into a Nuxt project.
The thing that I'm looking to do is to deploy Nuxt as a server target: 'server' (which is the default) alongside Django in Docker containers.
The idea is to be able to start the application with a simple docker-compose up.
I'm not done yet but you could look at it.
Typically, your docker-compose file would have 3 service :
The Django backend (API)
The Nuxt frontend (which make calls to the backend API)
Nginx which would route the traffic to Django or Nuxt according to your needs
EDIT BELOW :
Meanwhile, I changed my mind and instead of having Nuxt running as a server, I only have 2 containers :
The Django backend (API)
Nginx which serves my built Vue frontend and routes the traffic accordingly

Can I deploy the Django Rest Framework project on Firebase?

We are developing an application using Vue.js and Django. The essence of the application: accept user requests from the form, send them for approval to the backend and send an answer to the frontend. On the localhost everything is already organized and working. Now our frontend is on firebase and I want to deploy my backend part somewhere. So, can I use firebase for deploying my part? Š’ecause I met different ambiguous answers to this question
You cant, I guess you are using Django Rest Framework with Vue.js. So you need deploy your back-end to some machine. You can choose any hosting which can propose you Linux machine. GoogleCloud, DigitalOcean, AWS, Heroku and a lot of others..
I like AWS (In your case as a new user you can run free EC2 for 12-month, if you do not need a lot of performance)

Deploy angular 8 and django rest framework

I have successfully deployed django rest framework backend and angular 8 frontend apps independently on Heroku. I'm clueless whether they should be deployed as separate apps or should be integrated on single instance. What is the best practice when it comes to DRF and SPA,particularly angular? If to be deployed as independent app,how can I configure DRF backend to respond to the frontend in another server. Any help would be appreciated. Thanks

Django REST API as backend and ReactJS as frontend integration

I'm learning ReactJS and I already have experience with Django and DRF. My aim right now is to build a rather simple web application based on a Django backend and a ReactJS frontend. (Later on, when the web app is done, I'll tackle React Native).
I've been reading tons of documentation but nothing has sorted out the question:
What is the best approach to integrate a Django backend with a ReactJS frontend?
Should I keep them separate and connect them or should I mount ReactJS inside the Django application? Which one is the best-suited approach, taking into account maintenance and further development?
Thank you very much! Any opinion/hint will be appreciated.
My approach would be make an app called frontend or anything you like in Django, then all of my React code will be placed inside that app. You will also need webpack to bundle your React code then with collectstatic command Django will collect all the static files so it could be served. You can find the tutorial here