Note: for support questions, please use one of these channels: https://github.com/angular/universal/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports. Also, Preboot has moved to https://github.com/angular/preboot - please make preboot-related issues there.
[ ] support request => Please do not submit support request here, see note at the top of this template.
What modules are related to this Issue?
[ ] webpack-prerender
Do you want to request a feature or report a bug?
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem by creating a github repo.
What is the expected behavior?
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 2.0.0-rc.X
Platform: [all | NodeJs | Java | PHP | .NET | Ruby]
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Just leaving this as a reference (http://sweetme.at/2014/02/17/a-simple-approach-to-execute-a-node.js-script-from-python/) on executing a node script from Python.
This would be awesome. Also, please make it generic enough so that it's not tied to a specific framework (ie Django only). There are many other great platforms (Pyramid/Pylons, Flask, etc)!
If anyone is interested in contributing to the Python integration let me know.
If you have any experience with Dukpy (https://github.com/amol-/dukpy) that'd be helpful as well!
I am very interested, especially in the Django use. @MarkPieszak -I am not sure if it is going to be any use, but you might have a look on how it is done for the react equivalent - https://github.com/markfinger/python-react.
Out of curiosity - what is the intended approach toward integration with the Universal?
agree with @mattpepin
Make it general use python Angular component renderer.
We are using only a django for back-end code in our company and it would be fine to have a ssr. I didn't work with duckpu but I work with angular for 1 year. I want to help where I can.
Its a great initiative to provide integration with django. I have worked on angularjs and angular2 extensively and used django as backend for my project. If you can tell me how to work on this approach, I will be happy to work on this guys.
@MarkPieszak - I would also like to contribute. Do you have any suggestions where/how to start?
Hi guys I use Flask , i am good on flask and i planning to use flask not Django
For everybody who gets to this ticket, I would like to share my findings.
We are currently implementing Angular with Angular Universal to a large e-commerce site. The backend is written in .NET, hence we were considering to use the .NET engine of Universal. Turns out the solution is bad compared to the Express, especially in terms of performance.
Here are results done with ab testing (1000 requests, 100 concurrent users).
Rendered components on page | 1 | 60 | 600 | 1800
-- | -- | -- | -- | --
.NET – response (ms) | 9 | 15 | 42 | 113
Express (NodeJS) – response (ms) | 5 | 9 | 33 | 99
.NET slower by | 80.00% | 66.67% | 27.27% | 14.14%
What I am trying to say is the Express engine works very well and there is no need to have a separate Python engine for Universal.
Hence, the solution is to have a node.js server next to Python API server.
The workflow is then following:
1 - request comes to load balancer (e.g. Nginx)
2a - If the request URI starts with /api, the request is sent to the Python API server
2b - If the request URI is anything else, the request is passed to the node.js server
It is important to undestand that the node.js does only the following:
1) it passes the request to the Angular Universal
2) Angular asks for data to the Python API server if necessary
3) the rendered HTML is returned
=> Use Python API server along the node.js sever
Closed in favour of https://github.com/angular/universal/issues/1000
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
For everybody who gets to this ticket, I would like to share my findings.
We are currently implementing Angular with Angular Universal to a large e-commerce site. The backend is written in .NET, hence we were considering to use the .NET engine of Universal. Turns out the solution is bad compared to the Express, especially in terms of performance.
Here are results done with ab testing (1000 requests, 100 concurrent users).
Rendered components on page | 1 | 60 | 600 | 1800
-- | -- | -- | -- | --
.NET – response (ms) | 9 | 15 | 42 | 113
Express (NodeJS) – response (ms) | 5 | 9 | 33 | 99
.NET slower by | 80.00% | 66.67% | 27.27% | 14.14%
What I am trying to say is the Express engine works very well and there is no need to have a separate Python engine for Universal.
Hence, the solution is to have a node.js server next to Python API server.
The workflow is then following:
1 - request comes to load balancer (e.g. Nginx)
2a - If the request URI starts with
/api, the request is sent to the Python API server2b - If the request URI is anything else, the request is passed to the node.js server
It is important to undestand that the node.js does only the following:
1) it passes the request to the Angular Universal
2) Angular asks for data to the Python API server if necessary
3) the rendered HTML is returned
=> Use Python API server along the node.js sever