S
S
sinoptis2019-02-15 15:27:24
Django Rest Framework
sinoptis, 2019-02-15 15:27:24

API in django site?

What is the best way to organize the project structure so that the site has its own api endpoint? Is it possible to create one project and just mix drf and normal page rendering in it, or is it worth creating separate applications and running several instances separately on the server? Will each of the approaches affect the performance in any way?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2019-02-15
@ulkoart

create separate applications and run several instances separately on the server
you can also within one application, you start conditionally 2 instances, one on port 8000, the second on 8001, in nginx you set proxy_pass to 8001 at the /api/ url, everything else to 8000 ... well, as an option.
on the topic, there is more a question of logic, if the API does not live a separate life, then I think there is no point in sharing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question