The best way to do web apps with Python?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • worzel

    #1

    The best way to do web apps with Python?

    What is the best way to web developemnt with Python? Is there anything close to PHP style in-page script placement that can create and use other Python objects? I am not really interested in Zope (I believe that is more a CMS than anything else?) I am also looking for something a little more structured than a series of CGI Scripts.

    While on the topic - what is the expectataion of Python for this kind of stuff? Would one use Python for certain other things but turn to PHP for web apps - or would one use their Python skills in place of PHP?

    TIA
  • Paul Rubin

    #2
    Re: The best way to do web apps with Python?

    "worzel" <asda@sdarta.co m> writes:[color=blue]
    > What is the best way to web developemnt with Python? Is there
    > anything close to PHP style in-page script placement that can create
    > and use other Python objects? I am not really interested in Zope (I
    > believe that is more a CMS than anything else?) I am also looking
    > for something a little more structured than a series of CGI Scripts.[/color]

    Basically, yes, there are various Python template systems similar to
    PHP. I won't name them because other people more knowledgeable than
    me will do a better job than I could. I'll say that Python is a
    better language than PHP, but getting a basic dynamic web app running
    in PHP is much simpler than it is in Python. Python's advantage
    starts to shine once the app gets complicated.
    [color=blue]
    > While on the topic - what is the expectataion of Python for this
    > kind of stuff? Would one use Python for certain other things but
    > turn to PHP for web apps - or would one use their Python skills in
    > place of PHP? TIA[/color]

    It's sort of a difficult trade-off and it depends a lot on your
    application, who will develop and maintain it, who will use it, where
    it will be deployed, etc. Lots more people know PHP than Python, PHP
    is easier to get started with, and cheap PHP hosting is available all
    over. So if you're building some simple app that you want to
    distribute widely and run everywhere, PHP is attractive. If you're
    building a complex system which you'll run on a server that you have
    more control over, and you'll have relatively high-powered developers
    on hand to maintain the code, Python beats PHP.

    Comment

    • Pierre Quentel

      #3
      Re: The best way to do web apps with Python?

      worzel a écrit :[color=blue]
      > What is the best way to web developemnt with Python? Is there anything
      > close to PHP style in-page script placement that can create and use
      > other Python objects? I am not really interested in Zope (I believe that
      > is more a CMS than anything else?) I am also looking for something a
      > little more structured than a series of CGI Scripts.
      >[/color]

      There are quite a few web frameworks in Python, see
      The official home of the Python Programming Language


      I'm biaised in favour of Karrigell (http://karrigell.sourceforge.net),
      the "Python Inside HTML" pages look and behave very much like PHP

      Regards,
      Pierre

      Comment

      • JZ

        #4
        Re: The best way to do web apps with Python?

        Dnia Sat, 8 Jan 2005 21:11:49 +0800, worzel napisa³(a):
        [color=blue]
        > What is the best way to web developemnt with Python?[/color]

        Hmm. :) I prefer http://cherrypy.org + http://cheetahtemplate.org/. Very
        easy to learn and develop, yet powerfull.
        [color=blue]
        > Is there anything close to PHP style in-page script
        > placement that can create and use other Python objects?[/color]

        Check http://spyce.sourceforge.net
        or http://nick.borko.org/pse

        --
        JZ ICQ: 6712522

        Comment

        • Rob Emmons

          #5
          Re: The best way to do web apps with Python?

          > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">[color=blue]
          > <HTML><HEAD>
          > <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
          > <META content="MSHTML 6.00.2900.2523" name=GENERATOR>
          > <STYLE></STYLE>
          > </HEAD>
          > <BODY>
          > <DIV><FONT face=Arial size=2>What is </FONT><FONT face=Arial size>[/color]

          Just FYI -- the post you posted was in HTML -- you might want to avoid
          this in the future. 99% of all posts to news groups are in text, not
          html. Html is hard for everyone to read with normal news readers and not
          usually of any extra value. It's also more of a security risk to read it --
          because there is more potential for exploitation.

          Anyway, just thought I'd mention it if you didn't know.

          Take care,
          Rob

          Comment

          • Steve Holden

            #6
            Re: The best way to do web apps with Python?

            worzel wrote:
            [color=blue]
            > What is the best way to web developemnt with Python? Is there anything
            > close to PHP style in-page script placement that can create and use
            > other Python objects? I am not really interested in Zope (I believe that
            > is more a CMS than anything else?) I am also looking for something a
            > little more structured than a series of CGI Scripts.
            >[/color]
            More ways than you can shake a stick at, but nowadays you should
            consider using WSGI if you want your code to be portable across many
            frameworks. The Web SIG worked very hard last year on defining this
            gateway interface, with the intention that it should become widely
            available, and implementations are available now on environments as
            diverse as mod_python and CherryPy.

            You can read about it in Philip Eby's excellent PEP at

            This document specifies a proposed standard interface between web servers and Python web applications or frameworks, to promote web application portability across a variety of web servers.

            [color=blue]
            > While on the topic - what is the expectataion of Python for this kind of
            > stuff? Would one use Python for certain other things but turn to PHP for
            > web apps - or would one use their Python skills in place of PHP?
            >[/color]
            Python is a real programming language, whereas PHP was originally
            intended as a simple way of scripting web content. Since then it has
            grown to encompass many of the same features as Python, but since they
            were retrofitted rather than designed in they are sometimes kind of
            clunky (as, IMHO, is Perl, although in a different way).

            But there's a lot of good work been done in both PHP and Perl, and I'd
            usually recommend using existing functionality in either language over a
            just-for-the-sake-of-it rewrite in Python. But that could just be
            because I don't like re-inventing wheels.

            regards
            Steve
            --
            Steve Holden http://www.holdenweb.com/
            Python Web Programming http://pydish.holdenweb.com/
            Holden Web LLC +1 703 861 4237 +1 800 494 3119

            Comment

            • worzel

              #7
              Re: The best way to do web apps with Python?

              Holy Moly - there's quite a few choices out there! I like the look of
              Karrigel for my immediate needs.

              Looking forward to the day there is a more 'j2ee' like standard in place for
              Python - looks like this is in the works.

              Thanks for all the feedback guys.



              "worzel" <asda@sdarta.co m> wrote in message
              news:41dfdc15$0 $29387$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...
              What is the best way to web developemnt with Python? Is there anything close
              to PHP style in-page script placement that can create and use other Python
              objects? I am not really interested in Zope (I believe that is more a CMS
              than anything else?) I am also looking for something a little more
              structured than a series of CGI Scripts.

              While on the topic - what is the expectataion of Python for this kind of
              stuff? Would one use Python for certain other things but turn to PHP for web
              apps - or would one use their Python skills in place of PHP?

              TIA


              Comment

              • Ian Bicking

                #8
                Re: The best way to do web apps with Python?

                Paul Rubin wrote:[color=blue]
                > Steve Holden <steve@holdenwe b.com> writes:
                >[color=green]
                >>You can read about it in Philip Eby's excellent PEP at
                >>
                >> http://www.python.org/peps/pep-0333.html[/color]
                >
                >
                > I looked at this and I have the impression that it tries to do
                > something worthwhile, but I can't tell precisely what. The "rationale
                > and goals" section explains good reasons why it doesn't do various
                > certain things. What's not explained is what DOES it do. The only
                > thing I can tell is that it connects to an abstracted web server, and
                > builds up what looks like traditional CGI variables from the incoming
                > requests.[/color]

                It's really meant for web framework developers (as opposed to web
                application developers, who use web frameworks). Of course it's a fuzzy
                line, and people cross back and forth, especially since most all of it
                is open source.

                So basically it is what you were thinking -- it's a way to connect a web
                server to a web application, for any server or application, including
                current servers and applications (not just ones that are developed in
                the future). It can be a bit more interesting when you delve into
                middleware, which are programs that modify the request before handing it
                off to another application. But while that opens up interesting
                possibilities (I've used that technique a fair amount in WSGIKit:
                http://svn.colorstudy.com/trunk/WSGIKit/ ), but it's not incredibly magical.

                Mostly, it's the first forward movement we've had in a very long time,
                even if the movement isn't huge. It provides a foundation for further
                standardization .

                WSGI compliance also has some other potential benefits, like encouraging
                environment decoupling, and making mock requests easier to produce and
                responses easier to consume. But those are somewhat vague side effects.

                --
                Ian Bicking / ianb@colorstudy .com / http://blog.ianbicking.org

                Comment

                Working...