

Ask HN: What Python web programming frameworks and tools are you using? - akamaka

I'm interested in hearing from the community about what tools you are using for building web applications in Python.<p>This was last asked about half a year ago (http://news.ycombinator.com/item?id=1357925) and 
2 years before that (http://news.ycombinator.com/item?id=153487), but things are changing fast, especially with the recent popularity of NoSQL, so I think it's worth bringing up again.<p>So, what tools, databases, web servers and frameworks are you using for your latest Python web application projects?  Or, if you've abandoned Python, what language have you moved to, and why?
======
luffy
framework: Flask

database: Postgresql

server: UWSGI + Cherokee

Flask is a very nice framework, and the documentation is awesome. I've tried a
lot of Python frameworks out before deciding on Flask. It's a paralyzing
decision - there is just so much out there. The process of choosing a web
framework is filled with information overload - from reading about the
framework, dabbling with the code, and finally learning the actual framework.
For the reason, I recommend going with a microframework. You learn what you
need as you go. So this lead me to Flask.

Two things set Flask apart (for me) - the documentation and the extensions.
Just check out the site <http://flask.pocoo.org> for more information. You
also want to be assured that development on the framework is not just going to
be dropped some day. It really feels like this framework is going places. (My
initial inclination was toward CherryPy, but the documentation is bad. After
all these years.)

My dev work is mostly done on Windows, and for an IDE I've taken to using
JetBrain's PyCharm. (I'm primarily a .NET developer, and I find it more
convenient to use Windows to avoid context switching. The fact that I deal
with the massive and all-encompassing .NET is also a major reason I went with
a Python microframework). On Linux, I can get by with Emacs.

Using Ubuntu in production environment.

~~~
dawsdesign
I've used Django for years, but Flask is the bomb.

------
code_duck
Django, though I've realized that certain projects of ours could be
implemented better with a more lightweight framework. Other than that, not
much besides Komodo Editor and Kate and of course the rest of the usual LAMP
stack.

I'm quite satisfied with Python. I can't see any reason to move to another
language for general web development, but while Python is quite current and
modern, it isn't esoteric, geeky or on the cutting edge. So, I'm dabbling with
Clojure and Scala, specifically Scalatra and Compojure.

------
regularfry
First, a proviso: I'm learning. That being said, this is a commercial project,
so it's got proper constraints on it.

I'm using web.py, testing with nose, doing database work with sqlalchemy to a
postgres back-end. Looking at Paste and wondering if I should be using that as
well, but currently a simple apache2 mod_wsgi container is doing ok.

I deploy to Debian stable but develop on Ubuntu Lucid, which means that in
order to keep myself sane I've built Python 2.6 and virtualenv packages for
debian, and install all the packages I need with pip. I'm still getting my
head around this, because I've not used these tools at all before.

Deployment is done by pushing to a remote git master branch, where the remote
live branch is what's checked out and running.

Styling is all blueprint.css, and I'm contemplating whether to use my usual
Compass workflow or not. So far it's not been needed, but I haven't pushed
things very far yet.

I'm not in the sort of space where NoSQL would be an advantage, so I can't
comment on it.

------
madhouse
Python: Django (+ various modules) & fabric

Web Stuff: jQuery, less.js

Database: PostgreSQL

Tools: Emacs

------
macco
Framework: web2py With web2py the underlying tools don't matter much. For the
sake of completion: MySql, Apache, Ubuntu, jQuery, ez-css.

But you can use whatever you want.

------
rdw20101009
framework: NONE, NONE, NONE web server: CherryPy database: SQLite for
dev/test, PostgreSQL for prod, investigating NoSQL data access: SQLAlchemy
database schema: SQLAlchemy-migrate OS: Ubuntu, but perhaps eventually NixOS
DVCS: Mercurial via BitBucket dependency mgmt: APT, setuptools, perhaps Nix
JavaScript: MooTools

I am a web application security engineer (among other things), so I screened
and was forced to reject all frameworks because they don't adequately address
security (not even webpy), and because they are too heavy.

Instead, I am building a very lightweight, simple, but integrated web content
generation layer directly in Python using built-in string formatting. I
construct a page using a trivial DOM-like object model that renders to a
string web response (HTML, CSS, JS). I push Model data into the DOM-like View
under the direction of a page Controller (MVC pattern). However, my View
contains the logic to properly encode output contextually to avoid common
security vulnerabilities in the web response. Likewise, I have exhaustive
input validation to deal with the data in the web request.

------
andymoe
\- TextMate

\- Google App Engine

\- <http://www.tipfy.org> (GAE specific framework)

~~~
vosper
I hate App Engine, but unfortunately I will probably be doing at least a few
more projects on it, so thanks for the link to tipfy, maybe it'll help.

~~~
luffy
I have a site using Flask on GAE, and it works pretty well. Here's a reference
to get started.

[http://www.franciscosouza.net/2010/08/flying-with-flask-
in-g...](http://www.franciscosouza.net/2010/08/flying-with-flask-in-google-
app-engine.html)

------
Luyt
CherryPy, in combination with oursql (+DBUtils to make it multithread safe
because libmysql.so isn't). Caching is done by memcached (plus, I must look
into Varnish). Templating by HTMLTemplate. I made two small patches to
CherryPy to make it more agreeable for a site which serves 900 domain names
(using the VirtualHost dispatcher).

------
endlessvoid94
Django.

Disclaimer: We're about to launch Djangy.com, so my opinion is obviously
biased.

~~~
sushi
I happen to have a djangy account and I tried some of it few days back. I made
a simple hello world app and deployed it but it took longer time to go live
than I had anticipated, esp. in comparison to Appengine.

Other than that I'd like if you could also give a sense of expenses that I
might run into if I deploy my app on djangy. The details in terms of pricing
are lacking there.

Just some feedback. I know it's in private beta. All the best.

~~~
endlessvoid94
Interesting. Thanks for your feedback.

Would you mind emailing me at dave@djangy.com? I'd like to ask you some
details about which app was yours, and what exactly your experience was. We're
about to roll out a TON of new changes within the next few days, and we'll be
inviting quite a few more users into the beta program. I want to make sure
we're covering all the bases and keeping users happy.

Thanks :-)

------
hanula
Setup: * Pylons+SQLAlchemy+formencode+Mako+WSGI apps * PostrgeSQL * Nginx

Tools: * Virtualenv * Fabric

Best combination. Zope, Django, Web2py, web.py are just not that flexible &
reliable for advanced web applications (IMHO).

~~~
mdipierro
and of course this is a completely neutral and unbiased suggestion. LOL

------
sry_not4sale
Bottle!

Deadly simple, but still everything you need :)

<http://bottle.paws.de/docs/dev/index.html>

------
Tycho
GAE confuses me. How does one create a dynamic user interface? Does Django
cover that? I'm trying to build a simple program that's a sort of GUI/wizard
for composing SQL queries. It would be dead easy in .NET but I don't know
where to start with GAE/Python. Is the idea that you build the front end in
Javascript/HTML and your Python code does the processing behind the scenes?
This is probably a n00b question but I'm finding it hard to get answers.

~~~
vosper
You can compose queries like this:

query = myModel.all().filter("property_1 =", value)

query = query.filter("property_2 =", value)

Here's a gotcha... be sure to have a space between "property_1" and "=",
"property_1=" won't work (but it won't raise an error either).

Be aware that the Datastore has very limited support for querying in general,
and you will certainly not have anywhere near the kind of power you are used
to when composing queries in .Net with something like LINQ.

GAE is a good start if you want to learn Python, but it is a terrible platform
for web development. You will find yourself stymied and frustrated by its
inflexibility, the need to give up your normalized data model from Day 1, lack
of referential integrity, and the awful performance compared to a real SQL
database.

Oh, and the constant outages, the scheduled maintenance that borks the whole
system for a week, the backup tool that takes 4 hours to run and then crashes
trying to restore the backups... I have a long list :)

~~~
Tycho
Thanks for the advice. My program wont be doing any heavy lifting, it's just a
simple tool to guide the SQL-writing process and save the user typing
everything out down to the last semi-colon; a visual aid really. All I need is
a tiny bit of graphical whizzbang, so it's not a totally static form - the
labels/menus change somewhat, more fields/labels are added, according to the
user input.

~~~
vosper
try to stop thinking in terms of SQL, if you can - although they call it GQL
it's only superficially similar. One particularly big gotcha is that you can
only return keys or whole objects in your queries, and if you return an object
it has to deserialize all the data associated with that object, so think twice
before storing binary data against a frequently queried object - look to the
BlobStore (this is NOT the same as a BlobProperty) or a separate object to
hold larger chunks of data.

This is something to consider at the get go, you'd be surprised how quickly
performance degrades (ie a hundred or more items, not thousands)

------
iuguy
I use Django and PostgreSQL. Currently I'm using Eclipse which is much slower
than Vim, but leaves my Vim free to do more general text editing (like RST).

------
mhd
\- Emacs

\- Flask

\- a lot more JavaScript than before

------
dochtman
CouchDB (with couchdb-python) and Jinja on top of bare WSGI (through
mod_wsgi). Werkzeug is looking appealing, though. On the browser side, jQuery.

------
sgt
For what I use python for on the web at this moment, I basically use Pylons
and implement a RESTful API. I can then use jQuery on the front end.

------
tamentis
Pylons, Postgresql on Apache with mod_wsgi, I also have a few deployements
with cherrypy behind mod_proxy and a few wsgi apps without framework.

------
enduser
Django (with Jinja2 instead of built-in templates) and django_extensions

Werkzeug

Jinja2

PostgreSQL

Redis

fabric

celery

vim

git

------
gasull
\- Django

\- Vim

\- django-extensions

\- fabric

------
abiczo
Webob + a few WSGI middleware libraries, Mako, MongoDB, mod_wsgi (Apache),
Varnish

I'll probably try Flask for my next project.

------
rbanffy
stand-alone Django, GAE (and its built-in Django fragments). Database: MySQL.
IDE: Emacs and Eclipse (for GAE work) That said, I miss Plone and Zope. I
really wish we could return our heavyweight Java-based CMS and get our money
back...

------
dayski
django with postgresql. The reason for Django was because of the admin screens
that cut down the dev time for the custom cms that i built. if I take admin
screens out of the scope, I most likely would have gone with Pylons ...

------
crgwbr
Django OR cgi+flup+sqlalchemy

Idle and Visual Studio for editing

------
Maascamp
Tornado, Postgres, sqlalchemy, nginx, fabric, PyDev(Eclipse)

~~~
thedangler
how did you get that setup working?

------
didip
framework: Tornado

database: MySQL with MySQLDB

web server: Tornado, fronted by Nginx

monitoring: supervisord and Monit

NoSQL: redis (for search index)

------
aitoehigie
framework: web2py Postgresql Blueprint CSS Linode JQuery

------
MOdMac
Django

PostgreSQL + Mongo + Memcache

Apache + wsgi

------
endtime
Django on RHEL with nginx/apache, pip, virtualenv.

------
kwellman
Tornado MongoDB Vim Fabric

------
ctkrohn
PyTables, Django, Piston

------
sleepdev
Tornado, nginx, MySQL.

------
kqueue
webpy, mako templates, sqlalchemy, nginx

