views:

177

answers:

6

What web frameworks are available with python?

Just to be clear, python is just a language so if you want to run it on a web server (like apache?) you NEED a web framework?

A: 

The most obvious one is Django, it's very mature and quite popular.

I also found this list on python.org which describes the different frameworks available from basic, to full stack

Neil Aitken
hmm, little bit confused by the two downvotes. ah well.
Neil Aitken
+8  A: 

Take a look at This wiki page. It lists a few web frameworks for Python.

I personally happen to like Django, and web2py also looked very good. But no doubt others have different preferences.

Also have a look at some other SO questions: this one, or this one, and this one. All about Python web app frameworks.

But, as I said, you don't need it. They typically take a lot of work out of your hands, have premade login functionality, protect agains SQL Injection attacks and more of that stuff. You could do all of that yourself :)

extraneon
Django is the most used right now, a lot of people think it's superior to RubyonRails...
ptikobj
does Reddit use django?
Blankman
Reddit uses Pylons - http://en.wikipedia.org/wiki/Pylons
ceejayoz
A: 

I've found Tornado to be quite good some a lot of things. It's much slimmer then Django, and it can handle requests asynchronously, making it great if you want to do any kind of long-poling requests.

defrex
A: 

Just to be clear, python is just a language so if you want to run it on a web server (like apache?) you NEED a web framework?

No. Web frameworks are never required. They simply make your life easier. Any language can output HTML if you want it to, but frameworks take a lot of the work out of things.

ceejayoz
I was just curious, like when these big sites say 'python' in their job descriptions, they don't specify django so they must have rolled their own.
Blankman
Not necessarily. Someone who knows Python should be quickly trainable on the various Python frameworks, so it makes more sense to get a larger pool of qualified applicants by just saying "Python".
ceejayoz
@Blankman, That conclusion does not follow. It would be interesting to know what big sites you're talking about and so forth. A whole lot of places with huge web sites don't use Python for the same parts of the sites that Django would do.
Mike Graham
+2  A: 

If you ask for a method as simple as posible to run python on a web server, you can use conventional cgi.

You can also use, for example, mod_python with Apache.

So the answer is no, you don't need necessarily a web framework

joaquin
Although for strict definitions of "need" it's of course true you don't need a web framework. Most of the time when someone is trying to avoid web frameworks, it is a poor decision not to, and people are only avoiding it because they're used to messier, less-maintainable, less-scalable, less-secure paradigms.
Mike Graham
Agree mike, but I was just trying to answer 'python is just a language so if you want to run it on a web server (like apache?) you NEED a web framework?'.
joaquin
mod_python is an awful choice for writing a web-app. You have to synchronize versions of several things whenever you want to upgrade one and it does not provide a good interface. I would never use it for any web app. If I wanted to do something ultra-simple, I'd still use a framework (probably a lighter-weight one like Werkzeug if I wasn't influenced by other factors) or CGI long before mod_python.
Mike Graham
@joaquin, It's not always the most helpful to answer a question completely directly. For example, if someone asked me, "Is it possible to hit strangers with baseball bats?", the answer would be "Yes, it's possible," but I'd be remiss if I didn't say, "But you really shouldn't do that. Most of the people doing that ended up hurting people and going to jail."
Mike Graham
A: 

web2py is the easiest to start with. It is only one with a web based IDE (although you can use it the old fashion way like people use Django), a ticketing system that logs all errors, and code can run unmodified on Google App Engine. Its Database Abstraction Layer that supports 11 different backends. You can try it online without installation here. It has the most extensive free online documentation. It is less popular than Django because it appeared less than 3 years ago.

mdipierro