Python3 on the Web

  • Thread starter Johannes Permoser
  • Start date
J

Johannes Permoser

Hi,

I wanted to learn Python from scratch and start off with Version 3.
Since I already know PHP very well, I thought it would be nice to start
off with a small web-project.

But what's the way to bring python3 to the Web?
mod_python isn't available, cgi is said to be slow, mod_wsgi looks
complicated...

What would you suggest?

Greets, JP
 
B

Bruno Desthuilliers

Johannes Permoser a écrit :
Hi,

I wanted to learn Python from scratch and start off with Version 3.
Since I already know PHP very well, I thought it would be nice to start
off with a small web-project.

But what's the way to bring python3 to the Web?
mod_python isn't available, cgi is said to be slow,

This comes from the CGI architecture by itself (IOW: it's totally
unrelated to the language used).
mod_wsgi looks
complicated...

It isn't, really - at least if you have enough knowledge of the HTTP
protocol, webservers and Python !-)
What would you suggest?


If what you want is to learn *Python*, start with CGI (it'll teach you a
lot about text processing and even possibily about web programming too)
- but be prepared to find CGI *very* low-level compared to PHP.

Else, forget about Python 3, and try some of the nice frameworks like
Django, Pylons, web.py etc...
 
G

Graham Dumpleton

Hi,

I wanted to learn Python from scratch and start off with Version 3.
Since I already know PHP very well, I thought it would be nice to start
off with a small web-project.

But what's the way to bring python3 to the Web?
mod_python isn't available, cgi is said to be slow, mod_wsgi looks
complicated...

Is it WSGI you really mean is complicated or mod_wsgi itself? They are
not the same thing, with mod_wsgi just being one implementation of
WSGI.

In comparison to mod_python the mod_wsgi package is simpler to install
and setup, but then if you really meant WSGI as a concept then it is a
different matter and yes without using some higher level WSGI
framework or toolkit, then WSGI can be a bit more daunting and might
appear more complicated, or at least less helpful, than mod_python as
far as getting started. This is because mod_python is actually two
parts. These parts are the low level web server interface, akin to
WSGI level, and its higher level handlers. The mod_wsgi package
doesn't have the higher level handlers as expected you would use any
WSGI capable package for that.

As others have said, perhaps start out with Python 2.X for now if you
are just getting into this. This is because little work has been done
yet on getting any of the Python web frameworks/toolkits running on
Python 3.0 even if mod_wsgi is already ready (subversion copy) to host
them on Apache.

Graham
 
P

Paul Rubin

Tim Roberts said:
At that level of load, CGI is perfectly workable, and it's certainly the
easiest of the choices for development and exploration.

One problem of CGI even at very low loads is that it's harder to
handle the case where two hits arrive at the same time and want to
save data. You either have to mess around with file locking and
waiting, or use an external database that handles concurrency
(normally this means you end up with a persistent process anyway), or
some other kludge. With a persistent server you can use
SocketServer.ThreadingServer and ordinary python queues to communicate
with a single thread that's in charge of the persistent data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top