[Tutor] Why not to use include?

Kent Johnson kent37 at tds.net
Mon Jun 9 19:48:50 CEST 2008


On Mon, Jun 9, 2008 at 11:54 AM, Dotan Cohen <dotancohen at gmail.com> wrote:
> I must learn about these things, I've discovered, in this order:

I suggest you look at Django, it helps with most of this. Probably
TurboGears does also but I'm not familiar with it.

> 1) How to use Python as an apache module, not as cgi. Each page, at
> least to the outside world, must have an .html extension.

No problem, your URLs can look however you like.

> 2) I must learn about classes, and how to include classes in specific pages.

This sounds like general programming stuff but if you are talking
about your header includes, Django template inheritance provides a
good way to include boilerplate on each page.
http://www.djangoproject.com/documentation/0.96/templates/#template-inheritance

> 3) How to access GET, POST, and environmental values in Python. By
> environmental values I mean the requesting page's IP address, UA

In the Django request:
http://www.djangoproject.com/documentation/0.96/request_response/#attributes

> details such as preferred language and charset (which I use to serve
> the homepage in one of two languages), the query string, etc.

Also in the request, if I understand correctly.

> 4) How to access and work with MySQL. I am familiar with SQL, it is
> just the python integration I need to learn (how to send a query, how
> to parse the reply).

http://www.djangoproject.com/documentation/db-api/

> 5) How to work with cookies in Python.

Not sure why you need this but Django has support for cookie-based
authentication.

> 6) How to send mail with Python and sendmail.

http://code.djangoproject.com/browser/django/trunk/django/core/mail.py

> 7) How to manipulate images with Python. From what I understand this
> is _not_ possible, so I may have to stick with php on this one.

See Python Imaging Library
http://www.pythonware.com/library/pil/handbook/index.htm

Kent


More information about the Tutor mailing list