Python web frameworks vs Java web frameworks (how is web development in Python done?)
Asked Answered
I

4

6

I am thinking in starting a personal pet web project to experiment with different things and extend my knowledge.

I use Java a lot at work (for web applications :D) and was thinking in making my own in Python since I kinda like this language but never passed the simple scripts stages.

I want to step up a gear regarding Python (using 2.6.5) and don't know what to expect or what framework to choose from: Django, Pylons, web2py etc.

I also don't know how much these frameworks will offer me and how much will I have to write from scratch.

I could use a comparison with Java if somebody can provide me with. I'm thinking at filter functionalities such as sitemesh, custom tags like JSTL; In Python, can I write clean pages of HTML with tags in them or write a lot of print statements (something like servlets did in Java etc?

I don't know exactly how to phrase this question.

I actually need a presentation of how web development is performed in Python, at what level, and what the web frameworks bring to the table.

Can you share from your experience?

TIA!

Intransigeance answered 5/2, 2011 at 19:57 Comment(1)
Who in the world did vote "Too localized"? XDPochard
H
2

Python web frameworks run the full gamut of capabilities/facilities, all the way from shims around WSGI such as Bottle and Flask, all the way to full frameworks such as Django and TurboGears, and even "megaframeworks" such as Zope. Each does things slightly differently, but there will be some familiarity from one to the next.

Hinson answered 5/2, 2011 at 20:9 Comment(0)
S
3

hi try bottle python framework (bottle.paws.de / bottlepy.org) its really nice to use blistering fast and gets out of your way + the best thing about it is that its one single file to import, i recently migrated from PHP and i have to tell you am so ... loving it!

Sportsmanship answered 5/7, 2011 at 17:18 Comment(0)
M
2

It may sound strange, but there's no need to know "how web development is performed in Python" to start doing it.
In fact, working with language/framework/etc is a single most reliable way to get understanding of it. You won't gain a lot from one-page summaries.

Also, comparing it with Java isn't likely to help. There's no point in doing "Java-style development in Python". If you want to benefit, you'll need to clear your mind and do everything "Python-way".

As to what Python framework to choose, Django seems like like a good starting point. It's very popular, which means you won't be left without tutorials/documentation/help.

PS Short version: just do it.

Mikiso answered 5/2, 2011 at 20:6 Comment(2)
You are saying to think like a Pythonista. I understand that, but I want to know what parts do the frameworks help me with. Do they just abstract HTTP operations? Do I need to read and write request parameters or does the framework do a binding of those into a form object (like Struts ActionForm) or command object (like in Spring)? That sort of thing. That is why I was thinking as a comparison with Java.Intransigeance
@Intransigeance Yes, and you can learn it the best by doing it (which you were going to do anyway, according to the beginning of your post)Mikiso
H
2

Python web frameworks run the full gamut of capabilities/facilities, all the way from shims around WSGI such as Bottle and Flask, all the way to full frameworks such as Django and TurboGears, and even "megaframeworks" such as Zope. Each does things slightly differently, but there will be some familiarity from one to the next.

Hinson answered 5/2, 2011 at 20:9 Comment(0)
L
2

Python web frameworks do it in a similar way as some Java-based frameworks. I can speak for Django here.

A good comparison could be Play! vs. Django. Both of them foster using an MVC architecture (or MTV = models, templates, views) and already provide you with a lot of things like CRUD operations in admin pages, ORM, authentication, URL configurations, a template language and much more.

Other Java-based frameworks might differ a lot, and I can't give you a general answer. Depending on the choice, there are only few differences. You can simply choose the language and framework you like the most. I'd recommend to go through some tutorials (Django tutorial, Play! framework tutorial for instance) and look which one works best for your needs.

Liberalism answered 5/2, 2011 at 20:20 Comment(1)
It's right to mansion MTV here, because that pattern wasn't very clear for me at start (what a heck, where are controllers ???) =).Digitate

© 2022 - 2024 — McMap. All rights reserved.