views:

7481

answers:

17

I know there are a ton of Python frameworks out there. Can you guys point me in the right direction? My primary concern is simplicity, I don't need a lot of extraneous features. Here are a couple of other things that I'd want (or don't want):

  • don't care for ORM, just want it to work with MySQL
  • has configurable routes
  • has support for layouts
+2  A: 

Django!

Google App Engine uses it.

I use it too for my own pet projects.

Ngu Soon Hui
+2  A: 

Django. You don't have to use the additional features, and it's well designed so you can mix-n-match 3rd-party libraries as needed.

John Millikin
+4  A: 

Yes, I would say Django is definitely the way to go. Its modular design ensures that you can mix and match components (ORM, templating engine, URL dispatch, ...) Instead of being stuck with a component the framework provides you, you can replace it with any 3rd party equivalent instead.

Gabriel Ross
Changing a component *has* it's price. Eg.: changing the ORM or the templating will interference with the admin interface.
pihentagy
It doesnt interfere. The admin is not part of django, it's an external app. It doesn't care what ORM you use. What's more you don't have to use the admin. But you can run the admin (that will use django ORM) and another ORM at the same time.
e-satis
+2  A: 

I'm really new on Python but I tried quiet a few, specially Django and web2py. I loved the simplicity of web2py, I was able to create a site of medium complexity in a few days. It has an imprecessive sets of feature a DAL, code generation, HTML hlpers and for me the most important feature was the documentation in the site is quite complete.

A: 

Django:

http://www.djangoproject.com/

u can find intro's to it here (google tech talk, by Jacob Kaplan-Moss):

http://video.google.com/videoplay?docid=-70449010942275062&ei=YSHPSMqqIZH8qAP81eStAg&q=django

And here u will find Adrian Holovaty's talk he gave at snakes and rubies at depaul university: http://www.vimeo.com/1280871

Nolan Evans
I downvoted because of txt speak.
Will Harris
+6  A: 

Pylons.

It's much better than django, and doesn't come with a crappy ORM.

Aaron Gallagher
Just notinh that just because Django comes with a (supposedly) crappy OR/M, does not mean you have to use said OR/M, thanks to Django's modular nature.
Lucas Jones
ahaha, keep telling yourself that. Django is the most monolithic python web framework in common use.
Aaron Gallagher
+3  A: 

Give web.py a try. It's very simple and my provide the minimalism you are looking for.

+5  A: 

If you want something simple, without having to make your own framework, while still not being all inclusive (django), you might want to try CherryPy. It can use almost any dispatcher (Page Handler / URL routing system). You would also have to pick your own templating engine, Genshi is my favorite.

alif
+1  A: 

I would take a look at Pylons; it is lightweight and fast.

+1  A: 

I'm also on the Django boat. Here are a few reasons why:

Ross
+7  A: 

People already gave many answers concerning web application frameworks, but MVC (or any other paradigm) is not tied to web only. That's just for clarity.

If you are about plain MVC, Pylons conforms to paradigm in a stricter way. Django interprets MVC and they call it model-template-view, but the idea of role separation is the same. Actual choice is a matter of personal taste, although none of these two I consider lightweigth (Pylons might seem lighter, but in fact is not, and recently Django gathered some additional weight - most likely you will not fit even small application like personal blog in 20MB resident memory).

Of course, nothing will stop you from writing your own framework, eg. with WebOb. You can make it as light as you want (and learn many things trying).

zgoda
+9  A: 

Since you explicitly don't want an ORM, I'd stay away from a "full stack" framework if I were you. Python's WSGI standard gives you a ton of easy-to-use options that will give you just the features you need and even let you choose your style of working.

Here's an example: for URL dispatch you can use Routes, which ports over the URL dispatch style of Rails. Or you could combine Selector with WebOb if that style suits you more.

For "layouts", you can use the powerful Jinja2 if you want templates that cannot run code. Or, Mako if you prefer to be able to mix a little code in with your templates. You can even use Deliverance to control the layout of pages that are composed from multiple apps and even multiple languages!

A full-stack web framework is nice in that it makes a bunch of choices for you, letting you pay attention just to the app your building. But, the choices I've listed above are a good collection to get you going building your own. If you head down that path, you'll find it easy to plug in Beaker for caching and sessions if you need them, or WebError to help you with debugging.

Personally, I'm a big fan of ORMs (particularly SQLAlchemy), but if you're looking to go ORM free and lightweight overall you can't beat combining the great WSGI components available in Python.

Kevin Dangoor
+2  A: 

web2py! django calls a controller a view, 'nuf said.

But their View is basically the same thing as an MVC Controller. If the pattern is still MVC and you understand the design, does the nomenclature really matter? I guess you might call it MTV to follow the Django nomenclature (model-template-view), but then there would probably be law suits.
Neal S.
+14  A: 

web2py is 265Kbytes of source code and 1.2MB all inclusive (compare with 4.6MB of Django). Yet web2py will do everything you need (manage session, cookies, request, response, cache, internationalization, errors/tickets, database abstraction for GAE, SQLite, MSSQL, MySQL, Postgres, Oracle, FireBird, etc.) It does not need installation - just unzip and click on it - and you can do development in your browser.

Web2py has both routes and reverse routes.

Web2py has a hierarchical template systems which means a view can extend a layout which can extend another layout, etc. views can also include other views.

massimo
A: 

When it comes to desktop applications Dabo is a good choice. It's a crossplatform framwork on top of wxPython which supports MySql, Postgresql, Firebird and Sqlite.

+2  A: 

If you want simplicity use web2py or pylons. Django is good...but the learning curve is steep

+3  A: 

You want web2py. Check it:

  • don't care for ORM, just want it to work with MySQL

Web2py doesn't have a ORM, but it does have a syntactic wrapper over SQL that makes it much easier to do the SQL.

  • has configurable routes
  • has support for layouts

...web2py has both of these.

And web2py is more lightweight than django/rails/whatever on pretty much all counts. It's VERY easy to learn. The hardest things about learning a MVC framework are the scripts, the ORM, and (with django) the template language. But web2py got rid of the scripts, simplified the ORM, and the template language is just python in a rad clever way.

toomim