Do we have to use SPA with RESTful API backend?
![Multi tool use Multi tool use](http://sgv.ssvwv.com/sg/ssvwvcomimagb.png)
Multi tool use
I am curious about the question stated in the title.
I understand the pros/cons of SPA + RESTful stack vs Dynamic Web Pages.
But is it reasonable to use other front-end architectures to communicate with RESTful API backend?
Using Django as an example, can we create TWO Django applications, one serves as our front-end, one serves as our RESTful API Backend (via Django Rest Framework). When a user requests a page, the front-end application will makes calls to the back-end API to fetch and display the data, then sends back the requested page.
Appreciate your feedback/insights!
django web
add a comment |
I am curious about the question stated in the title.
I understand the pros/cons of SPA + RESTful stack vs Dynamic Web Pages.
But is it reasonable to use other front-end architectures to communicate with RESTful API backend?
Using Django as an example, can we create TWO Django applications, one serves as our front-end, one serves as our RESTful API Backend (via Django Rest Framework). When a user requests a page, the front-end application will makes calls to the back-end API to fetch and display the data, then sends back the requested page.
Appreciate your feedback/insights!
django web
1
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01
add a comment |
I am curious about the question stated in the title.
I understand the pros/cons of SPA + RESTful stack vs Dynamic Web Pages.
But is it reasonable to use other front-end architectures to communicate with RESTful API backend?
Using Django as an example, can we create TWO Django applications, one serves as our front-end, one serves as our RESTful API Backend (via Django Rest Framework). When a user requests a page, the front-end application will makes calls to the back-end API to fetch and display the data, then sends back the requested page.
Appreciate your feedback/insights!
django web
I am curious about the question stated in the title.
I understand the pros/cons of SPA + RESTful stack vs Dynamic Web Pages.
But is it reasonable to use other front-end architectures to communicate with RESTful API backend?
Using Django as an example, can we create TWO Django applications, one serves as our front-end, one serves as our RESTful API Backend (via Django Rest Framework). When a user requests a page, the front-end application will makes calls to the back-end API to fetch and display the data, then sends back the requested page.
Appreciate your feedback/insights!
django web
django web
asked Jan 3 at 4:03
GnahzNiXGnahzNiX
31
31
1
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01
add a comment |
1
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01
1
1
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01
add a comment |
2 Answers
2
active
oldest
votes
What you are saying is possible, whether it is a good idea completely depends on your needs. When using an API it is is quite possible that the API that you are calling is built with Django so in practice i'm sure there are a lot of Django backends communicating with each other. You can call your django-rest backend from wherever you want.
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
add a comment |
The basic idea of any Restful service is to have single backend to be able to communicate with multiple platforms like websites, Mobile app, IOT etc.
The intentions of SPA were clearly not to hit the server for every html page rather serve a single html page and change content based on the data or conditions using JavaScript. If you like to serve your SPA through django its possible to put the completely built index.html with all resources in static directory and serve through django which will internally use restapi.Then you Only need to write a single view to serve index.html file.
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016197%2fdo-we-have-to-use-spa-with-restful-api-backend%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you are saying is possible, whether it is a good idea completely depends on your needs. When using an API it is is quite possible that the API that you are calling is built with Django so in practice i'm sure there are a lot of Django backends communicating with each other. You can call your django-rest backend from wherever you want.
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
add a comment |
What you are saying is possible, whether it is a good idea completely depends on your needs. When using an API it is is quite possible that the API that you are calling is built with Django so in practice i'm sure there are a lot of Django backends communicating with each other. You can call your django-rest backend from wherever you want.
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
add a comment |
What you are saying is possible, whether it is a good idea completely depends on your needs. When using an API it is is quite possible that the API that you are calling is built with Django so in practice i'm sure there are a lot of Django backends communicating with each other. You can call your django-rest backend from wherever you want.
What you are saying is possible, whether it is a good idea completely depends on your needs. When using an API it is is quite possible that the API that you are calling is built with Django so in practice i'm sure there are a lot of Django backends communicating with each other. You can call your django-rest backend from wherever you want.
answered Jan 3 at 9:38
Jonas VandermostenJonas Vandermosten
668
668
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
add a comment |
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
But can you think of what are the needs to use a django as a frontend only project?
– GnahzNiX
Jan 4 at 3:41
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
You would just have everything you have for a regular django app but no model. Instead of the model you would send requests to your other backend.
– Jonas Vandermosten
Jan 4 at 10:13
add a comment |
The basic idea of any Restful service is to have single backend to be able to communicate with multiple platforms like websites, Mobile app, IOT etc.
The intentions of SPA were clearly not to hit the server for every html page rather serve a single html page and change content based on the data or conditions using JavaScript. If you like to serve your SPA through django its possible to put the completely built index.html with all resources in static directory and serve through django which will internally use restapi.Then you Only need to write a single view to serve index.html file.
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
add a comment |
The basic idea of any Restful service is to have single backend to be able to communicate with multiple platforms like websites, Mobile app, IOT etc.
The intentions of SPA were clearly not to hit the server for every html page rather serve a single html page and change content based on the data or conditions using JavaScript. If you like to serve your SPA through django its possible to put the completely built index.html with all resources in static directory and serve through django which will internally use restapi.Then you Only need to write a single view to serve index.html file.
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
add a comment |
The basic idea of any Restful service is to have single backend to be able to communicate with multiple platforms like websites, Mobile app, IOT etc.
The intentions of SPA were clearly not to hit the server for every html page rather serve a single html page and change content based on the data or conditions using JavaScript. If you like to serve your SPA through django its possible to put the completely built index.html with all resources in static directory and serve through django which will internally use restapi.Then you Only need to write a single view to serve index.html file.
The basic idea of any Restful service is to have single backend to be able to communicate with multiple platforms like websites, Mobile app, IOT etc.
The intentions of SPA were clearly not to hit the server for every html page rather serve a single html page and change content based on the data or conditions using JavaScript. If you like to serve your SPA through django its possible to put the completely built index.html with all resources in static directory and serve through django which will internally use restapi.Then you Only need to write a single view to serve index.html file.
answered Jan 3 at 17:38
Pavan Kumar T SPavan Kumar T S
635519
635519
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
add a comment |
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
You raised a point that I am interested too. When you said using django to serve SPA built index.html, is it simply just creating a view that returns that index.html?
– GnahzNiX
Jan 4 at 3:44
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
Yes thats true.just a single view to return index.html or just serve through url
– Pavan Kumar T S
Jan 4 at 4:59
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
You may need to put all js and css files in static directory and chenge their path in index.html
– Pavan Kumar T S
Jan 4 at 5:01
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54016197%2fdo-we-have-to-use-spa-with-restful-api-backend%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
5T,51rrRE9,T q2XqKBg9v
1
What's SPA? I haven't heard of that before.
– Red Cricket
Jan 3 at 4:15
Could mean single page application.
– Jonas Vandermosten
Jan 3 at 9:33
I am planning to split my DRF backend into two separate DRF projects. One will be a database to have an overview of products, their suppliers, prices, stock, etc. The other will be a backend for a webshop, the webshop backend will get some of its data from the "product" backend. I have these two now in one backend, but now I realize that I want them separated, since the two backend have their own distinct function/responsibility.
– Rik Schoonbeek
Jan 6 at 20:01