Django vs web2py for a beginner developer


Which of these two frameworks is better suited to a developer with 11 months experience. I have decided to learn python for my server side coding and wanted to know which of these would be better suited for someone at my skill level. I have just spent a few days playing around with web2py and really like it and i am wondering if Django offers something more that i am missing out on?

PS. UPDATE: Thank you all for the wonderful input, after buying three django books and going through a few small projects/tutorials for both django and web2py, i have settled on web2py. This is a wonderful framework, which makes web development really fun for a newbe. I would recommend all newbies to learn this framework as it will be mainstream in the future. Django is also a wonderful framework but web2py is just better in my limited experience opinion.

5/23/2012 2:32:20 PM

Accepted Answer

(disclaimer: I am the project leader for web2py)

Django has been around 5 years longer than web2py therefore it has more users and more applications to show off. Django has what they call "admin" which is not the same as web2py's "admin" but more like web2py's "appadmin". Django's "admin" is better and more customizable than web2py's "appadmin". Django does not have the equivalent of web2py's "admin". (sorry for the name confusion).

web2py is more compact and has more functionality out of the box (more supported databases, web based IDE, ticketing system, runs on GAE without patches, multiple login methods, role based access control, web based translation interface, support for multiple database connections, distributed transactions, and more).

For me the most important functionality of web2py is automatic migrations. Django does not provide them out of the box.

For web2py long term backward compatibility is a primary goal, together with security. Django is comparable to web2py in terms of security (except that web2py had CSRF prevention and default escaping in templates before they did) but Django broke backward compatibility when 1.0 was released. web2py never did since Oct 2007.

To me the web2py syntax is more natural:

 db(db.tablename.fieldname <= value).select() # web2py
 Tablename.objects.filter(fieldname__lt=value) # Django

I am not aware of any functionality of web2py that is not present in Django. I have asked that question many times because, if there is, we want to add it to web2py, but I have not yet received a satisfactory answer.

Of course there are things that we both do but differently. Django follows "explicit is better than implicit". web2py does not and instead follows "everything should have a default behavior". I believe this makes web2py code and configuration more compact.

Anyway, whatever you choose, they are both good solid web frameworks and there are fewer similarities than differences. Django's developers are very smart people.

The web2py community is very friendly. As an experiment, try asking a question on the web2py google group and on the Django group.

8/2/2018 2:58:02 PM

Both Django and web2py are excellent 'full stack' web frameworks with similar features and capabilities - you won't be 'missing out' on much as a beginner with either framework.

It's hard to answer your question without knowing more about what you want to do with your learning. Some would say that there is a danger of learning the framework and not the language so it might be best to get a deeper understanding of the Python language and lighter weight frameworks (e.g. Flask or wekzeug) first.

Having said that, web2py has a lower initial learning curve than Django as it was specifically designed as a learning tool. So I'd say you've made a good choice. No learning is ever wasted and if you decided you need something else in the future the good techniques you will have learnt using web2py will not go to waste.

Although there are more learning resources for Django, as it has been around longer and has more users, learning web2py is also fast because of the excellent book and almost instant responses to questions on the user group.

If you're looking to get a job, there are more Django jobs so that might be a factor. Having said that, the web2py community has recently set up experts4solutions where you could promote your skills and availability in the future.

Have fun!

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow