ASK HN: Python framework for someone new to language
I've read a lot here about Django and from the website the docs & guides seem pretty good and I think I'd be able to pick it up fairly sharpish. However, every time someone mentions Django there is a chorus of folks shouting "use X - it's better!" or "for eff's sake use Y! It has [unfamiliar-construct] which is essential!". Since I'm for all practical purposes on 'hello world' right now, I don't know how to evaluate these comments in the way I could with PHP frameworks for instance.
Now, I could just pick one up and go with it but I'm getting less & less free time these days and I'd like to waste as little as possible. Plus, I don't want to pick something that is perhaps for super-kings and will kill my enthusiasm.
TL;DR: If I go for Django, am I gonna be ok?
7 comments
[ 3.2 ms ] story [ 27.6 ms ] threadA full stack web framework. Try it.
It's hard to go wrong with django but I found web2py much easier to use and more productive.
Once you're comfortable with Django have a look at some of the other frameworks such as Flask or Tornado - they may suit your way of thinking better and may be more suitable for certain projects (for example GAE stuff). There's no need to get pigeon-holed into one framework.
Whatever you do, however, avoid web2py - it messes with Python internals in nasty ways and will teach you bad habits:
http://www.reddit.com/r/Python/comments/ex54j/seeking_clarif...
web2y also takes much less time to get up and running therefore it is no really extra cost to try.
Most concepts translate line by line (Django admin ~ web2py appadmin, Django request.POST ~ web2py request.post_vars, Django request.GET ~ web2py request.get_vars).
The latest web2py also use a thread local object (a cool stolen from Flask). web2py has a pure Python template language, Django has a domain specific language for templates that is not Turing complete. In Django you have to explicit about everything (for example you have to list all mapping of URLs into function calls) while web2py has defaults and conventions (which can be overwritten) and it feels closer to ruby on rails.
Web2py comes with more stuff in the box (more supported databases, runs on Google App Engine including db queries, credit card payment api, multi-tenancy, multiple types of federated authentication, pdf generation, hooks for nginx/gunicorn/gevent, etc).
Web2py does not mess with python internals and has more readable code than Django, for example it does not uses complex meta-class programming for the ORM. What some do not like (but buys you a loot of goodies) is that web2py executes some of your code instead of importing it. This allows hot plug and play of applications (even in production) and allows to run multiple apps under one server without library conflicts.
web2py is very secure. For example it had cross-site-request-forgery prevention 2 years before Django did, despite being at least 4 years younger.
Both can be used exclusively from the shell. web2py can also be used from the web based ide but does not force it on you.