W
W
WinRaR42021-01-06 11:48:50
Django
WinRaR4, 2021-01-06 11:48:50

How to link App.vue and django?

I can't seem to find any decent information on how to send requests to django with a view and process them there, returning a response to the front
. Just App.vue is a server with port 8080 localhost
Django - 8000 localhost
How to pass information in general? Which django file of the app should be linked in?
Do it by url localhost:8080?
How to write all this at all?
I really need it, I've been suffering for two months with no results at all ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dr. Bacon, 2021-01-06
@WinRaR4

1. Django is better not to know anything about Vue
2. Vue is also better not to know about Django
3. The exchange between them takes place using the REST API, which in Django is easiest to implement using DRF.

D
Dmitry, 2021-01-06
@dmtrrr

First you need to understand the basics of web development and understand how the front and back interact.
8080 localhost is a dev server, it is needed only for the convenience of development, it does not interact with django in any way.
Here is a good guide https://www.saaspegasus.com/guides/modern-javascri...

A
AveWycc, 2021-01-06
@AveWycc

VueJS and Django are two separate applications. You run them together and then with VueJS make requests (requests) to Django URLs, they can return (using the GET method, or do something using other methods) rendered HTML pages, JSON, XML, etc., as you prefer, VueJS this data receives and processes as needed.
The simplest thing is to do a REST API with JSON responses.
(Not advertising) I once made an application for Faceit, you can go to their website, click on the networks tab and look at the calls with the api signature, and what comes from there, you will see a regular JSON file that comes from the server and is already on your side is being processed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question