When comparing web2py vs Django, the Slant community recommends Django for most people. In the question“What are the best backend web frameworks?” Django is ranked 2nd while web2py is ranked 24th. The most important reason people chose Django is:
Django's philosophy of batteries included means that experienced developers won't have to plan too much ahead on what kind of application infrastructure they need and instead just start developing web applications quickly.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Documentation is written in form of a book which is good for beginners
web2py documentation does not follow the common pattern of using Sphinx, MkDocs or ReadTheDocs which is goos for exeperienced developers. Although documentation in form of a book is very easy and good for beginners. Turning web2py the most easy and comprehensive framework to learn and also to teach.
Pro Web2py apps run on GAE, AWS, VPNs, PythonAnywhere, etc
Web2py apps are designed to be portable. With some minor restrictions web2py apps can run on any VPS on SQL databases and/or Mongo, as well as on Google App Engine with the Google Datastore. It is truly code ones and run everywhere. For example at Camio.com we use web2py internally to access a GAE datastore which contains more images than Instagram.
Pro User support
The web2py community is open and friendly and it gives concrete support to newbies and old timers. It's not difficult to get answers from the BDFL Massimo Di Pierro himself.
Pro Maintainable over time
One really positive aspect of web2py application is their maintainability over the years. Old code works even if the framework is updated to the latest version. Not only that, if code is written well it is very short and a new team can pick it up over in little time.
Pro PyCharm supports web2py
While web2py has its own web based IDE which is convenient, it works with WinIDE, PyCharm, and Eclipse. The first two explicitly support web2py. The latter requires some configuration.
Pro Easy to learn without losing any power
web2py is very easy to learn for beginners, yet it has a great deal of power and flexibility as application needs become more complex. It includes an impressively comprehensive set of features, making development very productive without the need to integrate a lot of third-party libraries.
Pro Can be tuned to be really fast in production
The framework is really fast in production after some optimization and fine tuning which can minimize the memory footprint in order to make it run on a really small VPS or slice.
Pro Easily extendable
Allows users to easily extend functionality by using external libraries.
Pro No need to import the API to access the models and controllers context at every request
Models and controllers live in the context of the HTTP request. So the developer does not have to import the API to access this context at every request.
In other words, the models, controllers and templates in web2py use a domain specific language which uses pure web2py syntax and allows to import any module but exposes a few additional objects.
Pro Includes a web-based IDE for creating and managing applications
web2py includes an "admin" app that serves as a web-based IDE for web2py applications. It includes many features, such as application creation, compiling, and packaging; an error ticketing system; a code editor; a debugger; a controller doctest runner; Git and Mercurial integration; and one-click deployment to PythonAnywhere, Google App Engine, and OpenShift.
It is not intended as a full desktop IDE replacement, but it includes some helpful web2py specific functionality and can be convenient for basic editing and debugging tasks and quick prototyping, even for those who primarily work with a more full-featured desktop IDE or editor.
Pro web2py supports the classic editor Vim
Pro Developing a simple prototype can be very fast
Django's philosophy of batteries included means that experienced developers won't have to plan too much ahead on what kind of application infrastructure they need and instead just start developing web applications quickly.
Pro ORM support out of the box
Django supports Object-Relational Mapping. With models defined as Python classes which are actually subclasses of Django's django.db.models.Model
.
Each attribute of the model is then represented as a database field. Queries are lazily executed and Django gives developers an automatically-generated database-access API.
Pro Top notch documentation and help from community
The official Django documentation is probably some of the best around. Well written, thorough and they explain every little detail of the framework. Django is also a very popular tool, with an extensive community and a lot of experienced developers that have been using it for years. This means that there are a lot of guides and tutorials out there for new and experienced developers alike.
Pro Highly customizable
Django is in itself a highly customizable web framework. The database, template framework and ORM can all be swapped out.
Pro Has an admin panel out of the box
Django comes with a highly customizable admin panel and authentication out of the box. This makes the development and production of a simple CMS extremely easy.
Pro Mature software with many plugins developed over the years
Django was first released in 2005, it has had a lot of time to mature and become better with each release. It also has by far the largest community out of all python frameworks who have continuously over the years built and maintained many powerful plugins.
Pro Clear and defined MVC organization
Django follows some pretty well established MVC patterns. With everything in place and where requests follow a clear path through urlresolvers, middleware, view and context processors.
Pro Simple database management
Just a few lines of code can instruct Django to create all the tables and fields required in your database automatically. Schemas are managed with "migrations", that are also created automatically, and can be rolled out from your development box and implemented on production systems with just a single command.
This performs any database changes required, from table creation, indexes, renaming fields, and pre-populating initial data. Each migration builds on the previous migrations, so you can trace the evolution of your data and even recreate the layout of your database at any point in the lifecycle of your application.
Cons
Con Abandoned framework with (almost) no community
Con The web IDE is not a full-featured IDE
web2py includes an "admin" app that serves as a web-based IDE for web2py applications. It includes many features, such as application creation, compiling, and packaging; an error ticketing system; a code editor; a debugger; a controller doctest runner; Git and Mercurial integration; and one-click deployment to PythonAnywhere, Google App Engine, and OpenShift. However, particularly with regard to code editing and debugging and version control integration, it is not as full-featured as some of the more popular desktop IDEs such as PyCharm. So, developers expecting a PyCharm-like experience may be somewhat disappointed. In any case, use of the web-based IDE is completely optional.
Con Can feel bloated for small projects
Django's sheer scale and functionality can feel clunky and bloated for small applications. It has too many bells and whistles which can get in the way when developing a small scale application.
Con The documentation does not cover real-world scenarios
It is a larger documentation indeed, however is not deep and covers non real problems or even don't show any examples. You'll be better with Google or Stackoverflow
Con Routing requires some knowledge of regular expressions
Given a GET request for /topics/426/viewpoints/1/sections/create
, how does Django decide which bit of Python code is invoked to handle it?
It compares the request path to your giant pile of regular expressions.
And then if there's some other regular expression starts matching /top
and all your requests for /topics/
start going there, good luck figuring out why. You won't be informed of any conflict until you notice you seem to be getting the wrong pages back.
The structure of URL paths is almost universally hierarchal. There is no call to have anything as ridiculously flexible (and notoriously hard-to-read) as regular expressions to organize request routing.
Con Template errors fail silently by default
If you make a typo in a template variable, or change a view so that variable is no longer passed to the template, you won't get an error message pointing out that something has gone wrong. That reference will just be treated as if it is an empty string instead.
There is a way to configure this, but since so many templates have been written assuming this behavior, nobody ever enables template errors because it would break so much of the existing support tools (e.g. the built-in admin interface).