Quantcast

Server rendering react using cherrypy...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Server rendering react using cherrypy...

samslists@gmail.com
I have written a web app all in cherrypy and sqlalchemy on the backend.  

The front end is all react. (I use mako templates but basically just to create a single div, and call the react script).

The site has about 50 pages, but it's react that parses each of these urls and makes appropriate server calls for json which it then parses and displays.

I'd like to pre-render the pages on the server.  I've seen some tutorials and instructions for Python in general, but nothing specifically for cherrypy.

Is there any documentation on rendering react on the server using cherrypy?

Thanks

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Server rendering react using cherrypy...

Tim Roberts
On Jan 15, 2017, at 10:00 PM, Sam <[hidden email]> wrote:
>
> I have written a web app all in cherrypy and sqlalchemy on the backend.  
>
> The front end is all react. (I use mako templates but basically just to create a single div, and call the react script).

> I'd like to pre-render the pages on the server.  I've seen some tutorials and instructions for Python in general, but nothing specifically for cherrypy.

I'm a little confused by your description.  When I hear "front end" and "back end", I assume that web requests go into the front-end first, and the front-end internally makes requests to the back-end for data.

If that's the case, then your desire doesn't make much sense, because the react scripts will always see the request first.

If the requests go to CherryPy first, then you certainly have the opportunity to cache results into files and use them later, but you might consider whether using a reverse proxy as the first contact makes sense.

Tim Roberts, [hidden email]
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Server rendering react using cherrypy...

samslists@gmail.com
Hi Tim...

Sorry if I wasn't clear. Basically I want to use a package like this https://github.com/markfinger/python-react and am looking for a specific tutorial or how-to about using it with cherrypy.

I'm sure I can figure it out on my own, but if a how-to for cherrypy already exists, I'd like to read it, if only to save a few hours.

Does that explain what I'm asking better?

Thanks





On Sunday, January 15, 2017 at 11:23:21 PM UTC-8, Tim Roberts wrote:
On Jan 15, 2017, at 10:00 PM, Sam <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="rHKR_czxFgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">sams...@...> wrote:
>
> I have written a web app all in cherrypy and sqlalchemy on the backend.  
>
> The front end is all react. (I use mako templates but basically just to create a single div, and call the react script).

> I'd like to pre-render the pages on the server.  I've seen some tutorials and instructions for Python in general, but nothing specifically for cherrypy.

I'm a little confused by your description.  When I hear "front end" and "back end", I assume that web requests go into the front-end first, and the front-end internally makes requests to the back-end for data.

If that's the case, then your desire doesn't make much sense, because the react scripts will always see the request first.

If the requests go to CherryPy first, then you certainly have the opportunity to cache results into files and use them later, but you might consider whether using a reverse proxy as the first contact makes sense.

Tim Roberts, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="rHKR_czxFgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ti...@...
Providenza & Boekelheide, Inc.

--
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.
Loading...