Python web development that resembles PHP or classic ASP

Pierre Quentel quentel.pierre at wanadoo.fr
Tue May 27 11:30:22 EDT 2008


On 25 mai, 18:58, erik.oosterw... at gmail.com wrote:
> Hi All,
>
> I have been developing websites in classic asp using VB script for a
> long while now. Due to the fact that I also took a detour to
> developing ColdFusion, and the fact the companies I work(ed) for never
> had time or money for courses, I am now in the awkward position that I
> am -still- developing classic ASP.
>
> In it, I have become quite resourceful, I wrote a framework using WSC
> (windows scripting components) to separate logic from presentation,
> and my display pages use almost no logic, except for the loops and
> variables I need to build my pages. I have a three-tier setup and all
> business logic is in separate WSC files. The framework even uses an
> ORM for access to the tables of my database. This works like a charm.
> It makes classic ASP code maintainable, it makes working in classic
> ASP very pleasant actually and it makes our customers very happy.
>
> The problem is that classic asp is now a dead language, I need to
> modernize and fast! Although the arguments some people make against it
> are not valid for me (spaghetti code, unmaintainable, slow), I still
> see that there is little to no support for it anymore.
>
> The most logical way to "update" my knowledge to something more
> modern, would be to dive into ASP.NET. I considered that for a long
> time, but there are some problems with this:
>
> 1. I love the control I have over my html using inline, template-based
> vbscript. ASP.NET's web forms really sound like a very bad idea, also
> the approach Microsoft takes in trying to make a stateless web-app
> seem like a statefull application is IMHO a burden. I think webapps
> are inherently different than desktop apps, and should be programmed
> as such.
>
> 2. Who says Microsoft isn't going to pull the plug on VB.NET in a
> while or make a drastic change like they did from asp to asp.net
> again, some time in the future?
>
> 3. I like the rapid development I can do in a dynamic, loosely typed
> language like vbscript. The performance-bottleneck of a site is mostly
> in the database-access and the http-calls and I think writing all of
> the declarations and types for a strong-typed language is overkill for
> a webapp.
>
> So that's when I started looking at other dynamic languages for
> webdevelopment. I looked at Ruby on Rails and at the different web-
> frameworks that are available for Python. The biggest problem there
> for me is that the MVC type frameworks that are currently very popular
> are also not what I'm looking for.
>
> I like having my directory tree conform to the structure of my
> website, so the "Controller" part of the MVC style of development is
> something I wouldn't want. What I -would- like is a separation of code
> and display logic (so being able to include libraries in a page) and
> being able to intermix code directly into the HTML.
>
> As Python would be the language I prefer over Ruby, I thought I'd ask
> here to see if anyone in the Python community knows if such a
> development-framework exists in Python. For example, does IronPython
> also use the same web forms approach as asp.net using VB? The
> frameworks I looked at (Django, Pylons) seem to be able to use
> different templating engines, does that mean it's just a question of
> finding the right one?
>
> Also, for Python there is also the problem of meaningful indentation.
> I'm not even sure if it's possible to use Python directly inside HTML,
> because indentation would be at the very least tricky to maintain. I'm
> kind of hoping here that there are some solutions to these problems
> available in Python.
>
>  Any help would be greatly appreciated.
>
> Kind regards,
>
> Erik

Hi,

You can take a look at Karrigell (http://karrigell.sourceforge.net).
It's very simple to install, stable (the first version was published
in 2002) and among the programming styles provided you will find
"Python Inside HTML" which is as close as you can get to PHP or ASP

===================
<h1>Squares</h1>
<%
for i in range(10):
    print "%s :<b>%s</b>" %(i,i*i)
%>
===================

Regards,
Pierre



More information about the Python-list mailing list