[Tutor] web development question

Alan Gauld alan.gauld at btinternet.com
Sun Jun 21 22:41:02 CEST 2015


On 21/06/15 20:50, Laura Creighton wrote:
> > Its still just Python on the server? Very similar to Flask
> > but with a nice web based IDE.
> > But the UI (View) is still HTML/Javascript
>
> Maybe I am wrong, but I thought you could write in nothing but
> Python and HTML.  I am going to start playing with web2py tomorrow,
> so I will find out how wrong I was.

Like most Python web frameworks the server side is all Python
but the Views(UI ) are in HTML which includes any Javascript
you care to write. Web2py doesn't care about that it just sends
it to the browser which interprets it as usual.

So to write a modern-style web app with responsive UI you
still need to wite it in HTML/Javascript using a combination
of HTML5 and JQuery for the UI interactions/validations.

The connection between the web2py server side bits (in the
controllers) is the use of {{...}} markers within the HTML.
Anything inside the double curlies gets translated to HTML
by web2py, inserted into the View html and the View then
gets  and sent out along with the boilerplate in the
layout (html) file.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos



More information about the Tutor mailing list