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)
Related
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.
I created front end in Reactjs and backend in Django and linked using Django rest API. but react runs in localhost:3000 and Django in localhost:8000. How to combine or integrate these two and runs in the same address.
Development
If you are in the development phase and using Create React App then you can add "proxy": "http://localhost:8000" to your package.json. Then your api requests done in React will be forwarded to port 8000.
Production
The production setup is quite different. You'll want to run yarn build and let either Django itself or nginx serve the index.html. In that case there won't be multiple ports anymore since the React build is just static files.
I am creating an example real world project as we speak with the same stack (GitHub). It doesn't have production setup quite ready yet, but you can see my development setup if you want some inspiration.
You need to link them using the routes you created in your backend. Put the routes in fetch requests in React frontend and call them via GET or POST methods etc. Your users will only hit the frontend host address once you deploy your application to the server.
I just started learning Django and wanted to make an application with API (probably REST) endpoints so that other developers can use it as well (like GitHub API), and I could connect it to my react app and android app. I want my backend to be on a different server and do not want to build my react app integrated with Django backend using the REST Framework.
Can anyone just give me the general idea of what I need to do?
P.S. Sorry in advance if my question sounds silly, I am still new to backend.
Creating a Django REST API should be your first step. This is pretty simple if you already have a Django app running, and will allow your React app or Android app to connect and access data.
Authentication is a step beyond. You may want to look into implementing authentication on the server you will be hosting your back end on. You can also read through this article for some guidance on implementing auth on the DRF side.
Best of luck!
First off all you can start from this.
https://www.django-rest-framework.org/tutorial/quickstart/
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
I'm using Django Rest Framework for API service and Angular to use those APIs. How do I run Angular alongside Django Rest Framework on the EC2 instance using Amazon Elastic Beanstalk?
For example, Django Rest Framework serves up the API through http://test.com/api/v1/ and Angular makes HTTP requests to those API endpoints client-side.
What are the steps required to run Django Rest Framework API with an angular client side application on the same machine?
Any suggestions would be greatly appreciated!
It seems you are looking for a customized container that runs both a Python web app and an Angular app. The angular app accesses the django REST API on "localhost". I would recommend looking into creating a custom Docker container that lets you have this custom configuration.
You can read more on support of Docker containers on Elastic Beanstalk here.
While there may be simpler solutions out there I have been able to configure AngularJS + Django REST Framework to run on the same AWS instance. It's the accepted answer to this post https://stackoverflow.com/a/22852451/1759504
There I go into detail on exactly what I had to do to make it so my static AngularJS content runs from http://test.com/#/ while my APIs are at http://test.com/api/v1/