I see your point.

Perhaps I should revise my definition of 'static' and 'dynamic': when I 
generate an HTML using a view of web2py, everything returned by the server 
will stay the same and will potentially change only after I refresh the 
page - this is what I mean by static. On the other hand, on the same page I 
have a websockets connection to a tornado server, so that some contents of 
the page will update themselves (via Javascript) without having to refresh 
the page - this is what I mean by dynamic.

My question now is that, having these two backends (web2py and tornado), 
how should I setup this page on which the majority of the content are 
served by web2py and stay the same once they're loaded, while some content 
constantly update themselves through websockets to tornado?

Thanks.

On Monday, July 2, 2012 12:14:15 PM UTC-4, Wikus van de Merwe wrote:
>
> Your description is very confusing. Static content are the files that are 
> not dynamically generated but simply served over the network, e.g. images, 
> javascript, css.
> If you generate an HTML page using a view (template) and filling it with 
> data from DB, that is a dynamic page generation.
>
> Now, you want to use tornado + javascript to have a user side generated 
> page. And you want access to DB from the javascript? If so, try the REST 
> approach and
> expose the data as JSON. See this book chapter for details:
> http://web2py.com/books/default/chapter/29/10#HTML,-XML,-and-JSON
>
> But then the question is, what is the benefit of using tornado in the 
> first place if at the end your requests go to web2py anyway?
>
>

Reply via email to