Re: Server rendering react using cherrypy...

matt Gerwen van <[email protected]> Tue, 27 Feb 2018 13:07:09 -0800 (PST)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>
Hi Tim,

I also like to combine react 16.2 (native) with cherrypy. I'm not so good 
programmer, eventhough I like to learn and do some programming.  The 
examples of python-react are for Flask, not for Cherrypy. How did you go 
and did you solve this issue. Flask has it's own 'render-machine'. I like 
to hear from you, how you did go with it.

On Monday, January 16, 2017 at 10:14:27 AM UTC+1, Sam wrote:
>
> 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 <[email protected]> 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, [email protected] 
>> 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 cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.