开发者

What web framework to choose [closed]

开发者 https://www.devze.com 2023-03-20 10:59 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

I'm comming from java world (apache wicket) and need to use python for my project.

I've heard about Turbogear2, Pyramid(Pylons) or Django and read开发者_C百科 some about them. My first choice will be TurboGears2 built on top of Pylons, with tools already packaged, but perhaps someone as some advice.

I do not need to create a lot of content like wikis or blog, but represent and give access to some objects in my database, and then build a javascript interface to work on this data.

What I need the web framework to to for me :

  • authentication system with roles (admin, user, group,...)
  • use of enhanced javascript tools like dojo outside the app, but it would be good if I could share components between the app and the javascript library.
  • easy AJAX : components have to be refreshed 'onChange' (I don't like submit buttons)
  • a good ORM. Don't know SQLAlchemy but it seems nice, mapping object to/from database, database pooling,....
  • easy deployment (coming from java I think it will be ok ;))
  • add easily css or js to pages
  • a framework that don't break my nerves ;)
  • a good documentation and/or good support

  • threading/multiprocess support (there are a lot of calculations. Some of them taking huge amout of memory, some other taking processing time. So I want to be able to lauch procees out of application. But I think it's more about using a python library and nothing to do with this question? )

THX


For myself, mako + sqlalchemy in Pyramid are what seal the deal. If you're into some decent DB work, SqlAlchemy is just the best to work with. I'm also a big fan of the mako templates. The ability to create presentation type functions in mako itself that are reusable vs trying to do things in python modules that you end up trying to import in is a plus in my book.

What I really wanted to mention is that for your final item, you should really look at farming that stuff out to outside workers by using a message queue and something like Celery to do the work and use the web app more for submission/results display than actually trying to split the work out of your web application.


As pointed out by S.Lott in his comment, your requirements do not give a clear-cut "winner" as at least most of the frameworks have that capability.

Three dimensions along which which python web framework diverge more are IMO:

  • Closeness to the concept of "pythonic"
  • Lightness
  • Overhead

Typically lighter frameworks will: require more overhead and have a more pythonic approach (webpy, cherrypy...), while heavier frameworks (django, turbogear...) will let you have your app up and running in minutes but will somehow oblige you to shape your code in a certain (logical but not necessarily pythonic) way.

That said, I believe 95% of your answer relies on personal preference.

HTH!


In addition to the frameworks you have mentioned, you should definitely check out web2py. I think you'll find it among the easiest to set up, learn, and use, particularly given the breadth of functionality it offers. One if its primary goals is to not "break your nerves." It includes an excellent authentication system; integrated Javascript/AJAX support (see also components); a fast and powerful database abstraction layer; web services; automatic RESTful API generation; great documentation; and a very helpful and responsive mailing list. Development is very active, with new releases at least every month (without ever breaking backward compatibility). Here is a recent presentation.


An opinion piece...

I like the character of Pylons (now replaced by Pyramid) and the wide support of new initiatives by the Django framework (though not its keeness to reinvent so many wheels - esp. MVC).

I like the Data Abstraction Layer in Web2py that enables deployment to Google's AppEngine. This was a key feature in making my decision. Web2py is RoR inspired which some may shirk but which I've appreciated and so far hasn't blocked any development path.

In the end having tried several frameworks I've used Web2py (using the offical book as reference). A great community with very fast response.

0

精彩评论

暂无评论...
验证码 换一张
取 消