CherryPy vs Django [closed]
CherryPy vs Django, which would you use and why?
They're not exactly comparable. CherryPy provides url routing and a request/response abstraction, which makes prototyping very easy (although I find vanilla mod_python just as convenient). Django is a complete web application "stack", including a templating system and an object-relational mapper.
Django is vast, and difficult to learn, functions, tags and what not, you will absolutely are a computational genius if you have figured Django out completely. "full-stack" means every thing is available, you just have to spend the time looking for it :(
CherryPy is light and clean and far less complex. Compare the starter tutorials 1pg vs 4pgs you know what I mean. Its the difference between the "full-stack" java and the light and easy perl.
PS: the Django admin interface ROCKS!!
Though e.e. coli has already provided the accepted answer (and a good one at that), one thing I'll say in favor of CherryPy is that it is also implements WSGI out of the box. What this means is that, unlike the mod_python approach mentioned (which I believe is still an Apache-only solution)*, it provides abstraction from your web server. If you are all Apache all the time, this isn't so much a win, but if you ever think you may want to try alternate web servers, such as Lighttpd, then you can swap your web server w/o also having to make adjustments in your Python app. This was a big win for me personally.
*I don't mention Django here because I'm not a Django user (I don't like "full stack" frameworks) and so will leave any comments regarding it to it's many fans - all of whom are more qualified than I to answer questions about it.
Django, because the community is so much larger. You'll find more 3rd-party modules you can use and you'll find much more support.
I would use Django because of its large user base and existing modules (including the built-in admin interface) but I would imaging that CherryPy is more flexible than Django. You just have to look at the available options, figure out what you want to do and choose the platform that supports that the best.
CherryPy is web server "http framework", while Django supports web application front-to-end: it provides object-relational mapper, template, session management, automagically generates DB schema and all CRUD screens, and more.
I think they're both great, but I'm not a fan of full stack frameworks. CherryPy is a lot easier to use and much more flexible.
精彩评论