I started playing with a Python web framework called Pylons. I've been using Django for the last little while, but after hearing many positive feedback about the Pylons, so I decided it's time to get my hands dirty.
Although I've barely scratched the surface of Pylons, but here are some things I like about it.
- I love Python Paste. Deploying and dispatching your web app suddenly becomes very easy. You can even register your application at PyPi.
- The default Mako templating engine is very, very fast. It has a newline filter (backslash) to consume the newline character before moving to the next line -- which is useful if you want nicely formatted HTML. Comments can be multi-lined -- something I wish was possible in Django. And it's also nice to have arbitrary Python code embedded in the page... should be used sparingly, but really useful sometimes.
- SQLAlchemy is powerful. Arguably the best ORM in any language. Doesn't get in your way when designing your database and application architecture. You can map objects to any arbitrary joins or selects.
- Really gives you full control over your application. Pylons doesn't give you out-of-the-box admin or user authentication (like Django), but it does allow you to build your application exactly the way you want without having to work around the framework.
Don't get me wrong. I like Django, and will continue to use it where it makes sense. Forms in Django 1.0 is really awesome, and I especially like ModelForm for creating forms from models. The admin view that comes with Django is great, and saves a lot of development time.
If you do use SQLAlchemy with Pylons, you can always check out formalchemy, which many of the same functionality as Django's ModelForm, but with SQLAlchemy mapped objects. As a bonus, you can even use a Pylons extension with formalchemy that gives you automagically created admin interface for your objects.
And some more thoughts about Django.
- You can use SQLAlchemy in Django. That is, if you're willing to give up the built-in admin and generic views, and ModelForms.
- There are ways to get other more powerful Python templating engines into Django (e.g. django-mako), but it does require you do change your view code.
So here are my not-so final thoughts.
I'll continue to use Django for the many web applications that are basically just CRUD applications. For anything that you need to have fine-grained control over, Pylons seems to be the better choice. It also allows you do use