By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,627 Members | 1,211 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,627 IT Pros & Developers. It's quick & easy.

The best way to do web apps with Python?

P: n/a
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
Jul 18 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"worzel" <as**@sdarta.com> writes:
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.
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.
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


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.
Jul 18 '05 #2

P: n/a
worzel a écrit :
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.


There are quite a few web frameworks in Python, see
http://www.python.org/moin/WebProgramming

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
Jul 18 '05 #3

P: n/a
JZ
Dnia Sat, 8 Jan 2005 21:11:49 +0800, worzel napisa³(a):
What is the best way to web developemnt with Python?
Hmm. :) I prefer http://cherrypy.org + http://cheetahtemplate.org/. Very
easy to learn and develop, yet powerfull.
Is there anything close to PHP style in-page script
placement that can create and use other Python objects?


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

--
JZ ICQ: 6712522
http://zabiello.om
Jul 18 '05 #4

P: n/a
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<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>


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
Jul 18 '05 #5

P: n/a
worzel wrote:
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.
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

http://www.python.org/peps/pep-0333.html
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?

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
Jul 18 '05 #6

P: n/a
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" <as**@sdarta.com> wrote in message
news:41***********************@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
Jul 18 '05 #7

P: n/a
Paul Rubin wrote:
Steve Holden <st***@holdenweb.com> writes:
You can read about it in Philip Eby's excellent PEP at

http://www.python.org/peps/pep-0333.html

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.


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 / ia**@colorstudy.com / http://blog.ianbicking.org
Jul 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.