0% found this document useful (0 votes)
4 views19 pages

Web Programming with Python Overview

The document outlines a syllabus for a web programming course using Python, covering topics such as Python's characteristics, frameworks like Zope and Webware, and the MVC pattern. It discusses the use of SQLObject for database access and various Integrated Development Environments (IDEs) for Python and HTML. The conclusion emphasizes the effectiveness of Python and Webware in solving programming challenges and the support from their respective communities.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views19 pages

Web Programming with Python Overview

The document outlines a syllabus for a web programming course using Python, covering topics such as Python's characteristics, frameworks like Zope and Webware, and the MVC pattern. It discusses the use of SQLObject for database access and various Integrated Development Environments (IDEs) for Python and HTML. The conclusion emphasizes the effectiveness of Python and Webware in solving programming challenges and the support from their respective communities.

Translated by

ScribdTranslations
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Web Programming with Python

Marcelo Schiavone Carlos Taffernaberry


Syllabus

Introduction

Python

Framework for Python

Developing applications
– Cheetah
– Python
– SQLObject

IDEs

Example of use

Conclusions
Introduction


A little history

Current scenario

Component selection

Language:
– OpenSouce
– Performance([Link]
– Learning curve
– Popularity/trends ([Link]
– Project/Manufacturer Activity
Programming Language

What is Python?
Characteristics

Interactive, Interpreted, and Object-Oriented Language

Regardless of the paradigm
● A large number of standard libraries providing extensive support.
● It is portable to different Operating Systems.

Very easy to learn

Very mature language - (1991)

Programming Language Cont.

What is Python good for?

Python is applied to many problems of different types


Great Standard Library
Text Processing
Internet Protocols
Interface to Operating Systems
Example of Implementations
Anaconda Mailman
Yum Yum
Zope Webware
Companies that use Python
Google NASA
Yahoo ILM
Framework for Python

Alternatives:
– Zope
– Django
– Turbogears
– Webware

We use:
– Zope 2.7
– Webware 0.9
Webware
What is WebWare?
Main characteristics
Components
Kits:
WebKit UserKit
MiddleKit PSP Kit
Tools that integrate well with Webware:
Cheetah
SQLObject
WebKit: The Application Server

Main characteristics:
– Multithread
– Session support
– Servlets
– It works parallel to the server
HTTP (e.g. Apache)

Advantages:
– WebKit and Apache can reside in
different machines.
– The Servlets reside
permanently in memory and
they can be reused
– Connections can be maintained to
BD.
How do we adapt the MVC pattern to
Webware?
Cover View

WhatisCheetah?
Characteristics:
Template Structure (Page
html)withasublanguageof
data access in python.
Itcanbeusedintegrated.
in webware and as a module
independent
Example
#import time
<html>
The current time is $[Link]()
</h1>
</html>
Controller Cover

WhatisaServlet?
- Objetos que se ejecutan dentro
of WebKit
They are loaded into memory in the
first request
They can maintain status in
the application server
-Inherit from [Link]
or of any of its
descendants:
[Link]
[Link]
Cover Controller cont.

HowisaServletexecuted?
Theusermakesarequestofthetype:

[Link]

The context 'Context' and the servlet 'Servlet' are activated.


An instance of 'Servlet' is reused, or if it does not exist
a new one is created.
The methods are executed in sequence:

[Link](transaction)

[Link](transaction)

[Link](transaction)
Controller Cover cont


When inheriting from [Link], when the user performs a
the method that follows the word_action_ is called action

Example:
HTML File
<form action="gestorControl">
.....
<input type="submit" name="_action_registerMember">
</form>

Servlet Python
from [Link] import Page
class gestorControl(Page):
def registerAffiliate(self):
.............
.............
Model Cover - SQLObject


What is SQLObject?

Characteristics
– SQLObject produces the code
to access the database
– The code is not SQL, this
allows the no-SQL database to be
used in the same way
– Supported databases:
MySQL, PostgreSQL, SQLite
Firebird, Sybase, MaxDB and
MSSQLServer.
Available IDEs


Used Python IDEs
– SPE (Stani's Python Editor)
– DrPython
– Gvim
– Eric 3
– Eclipse

Used HTML IDEs
– Bluefish
– Nvu
Example of use

Use MVC pattern:


Cover View: Cheetah
Controller Cover:
Servlets (inherit from
[Link]
Cover Model: Python and
SQLObject
Modifying the
configuration of the
Model, works with
two DBs (Postgresql and
mysql
It can be modified the
user interface
(view cover) using the
same data model.
Conclusions
Python simply solved all the problems
that were presented to us.

Webware seemed to us a simple, 'lightweight' framework.


and with the basic features that we needed.

It helped us the ability of Webware to combine


different tools (that are not from Webware).

We had very good support from the communities, both


from Python as from Webware.
OpenHealth

Questions ???

Thank you very much for your attention.

desarrollo@[Link]
Additional material
Design with the MVC pattern
● What is the MVC Pattern?

Model Cover

Cover View

Controller Cover

Advantages
– Lower coupling
– Greater Cohesion
– Easier development for wealthy clients
on multiple devices and channels
– Facilitates maintenance
– Greater scalability

You might also like