Python3 on the Web

Discussion in 'Python' started by Johannes Permoser, Mar 5, 2009.

  1. 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
     
    Johannes Permoser, Mar 5, 2009
    #1
    1. Advertising

  2. 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...
     
    Bruno Desthuilliers, Mar 5, 2009
    #2
    1. Advertising

  3. On Mar 6, 4:13 am, Johannes Permoser <> wrote:
    > 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
     
    Graham Dumpleton, Mar 5, 2009
    #3
  4. Johannes Permoser

    Paul Rubin Guest

    Tim Roberts <> writes:
    > 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.
     
    Paul Rubin, Mar 8, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrey Tatarinov

    python3: 'where' keyword

    Andrey Tatarinov, Jan 7, 2005, in forum: Python
    Replies:
    97
    Views:
    1,869
    Andrey Tatarinov
    Jan 16, 2005
  2. Andrey Tatarinov

    Python3: on removing map, reduce, filter

    Andrey Tatarinov, Jan 9, 2005, in forum: Python
    Replies:
    18
    Views:
    1,243
    Steven Bethard
    Jan 11, 2005
  3. Replies:
    37
    Views:
    858
    Steve Holden
    Jan 14, 2005
  4. Aman

    Python3 Web Framework

    Aman, Dec 31, 2010, in forum: Python
    Replies:
    5
    Views:
    1,494
    Robert
    Jan 1, 2011
  5. Andrew Berg
    Replies:
    0
    Views:
    351
    Andrew Berg
    Jun 16, 2012
Loading...

Share This Page