[Tutor] web2py vs django

mdipierro mdipierro at cs.depaul.edu
Wed Sep 9 16:13:21 CEST 2009


If you know Django you basically know web2py. Let me address some of you
concerns below and then I will give you some examples:

> web2py
> Simpler syntax for doing things (This may be a nice factor, but then it
> does do more 'magic')
The only "magic" is that your code is executed in a context, not imported.
this makes sure there are no memory leaks, your app is dynamically updated
without need to restart.

> Unable to find generic views?
We have them but they are different than Django's. They are in
yourapp/views/generic.*
The main difference from Django is that you do not have to declare generic
views in url.py. I an action returns a dictionary, web2py will find a
generic view for you, depending on whether you requested the page in .html
or .xml or .json, etc.

> - Not sure how to begin
1) start the web server
2) open http://127.0.0.1/admin and login
3) use the form on the right to create a new app then edit the
model/controllers/views as you would in Django. You can use the shell and
emacs or use the web based IDE that comes with it (and we call admin).

> - Works with google app engine (not an issue for me, but thats pretty
> cool)
yes
> - Template stuff is pure python with no indentation (this is good!)
yes
> - Interface feels old. LIke pre 2003 way of doing stuff. feels like static
> html pages.
You are probably talking about the scaffolding application welcome, you have
not tried admin yet.

> - No importing of modules, all handled for you (this may not be a great
> thing. I am undecided still...)
Not quite correct. In web2py you import modules as in Django except that you
do not import web2py keywords and you do not import your own models. That is
done for you by web2py before controllers are executed. We follow the DRY.

Join us on the web2py google group and we will be happy to answer more of
your questions. We have video tutorials linked from the documentation page.


Stefan Lesicnik-2 wrote:
> 
> Hi guys.
> 
> I am writing this because i am little confused and wanted a more 'expert'
> opinion on the two frameworks. I am still quite a python newbie, and not
> really familiar with all the intricacies of it and the frameworks.
> 
> I discovered Django as a framework first. I thought it was really great.
> The
> tutorials makes sense, i really like the generic views (looks clean, added
> a
> filter, sorting works etc). The importing of various modules did confuse
> me
> a bit, but I think its something you can learn and work through.
> 
> A friend asked me if I had tried web2py, and started looking at it. I
> haven't looked as much as Django, but I also think its due to the fact
> that
> Django seemed to have more resources available to learn. The Django book
> is
> great. There are many video tutorials showing you how to start and get
> going. With web2py, i run it, and I actually dont have a clue what to do
> next...    Admittedly I have put more effort so far into learning Django.
> 
> I have purchased the web2py book, but havent gone through it yet in
> detail.
> 
> I plan on using either framework for a project i want to do that will
> contain a database of computer resources available, have a workflow where
> a
> user can request a service, administrator approve it, and the system will
> automate and build a machine, virtual machine and notify people. If that
> makes any difference to framework selection...   I guess im trying to
> choose
> the correct framework before I put alot of effort into a dead horse :)
> 
> Maybe to summarise what ive found so far (i know there are more, im coming
> from a newbie perspective here!)
> 
> Django
> - Great generic views (sortable, filters etc)
> - Nice admin interface
> - Looks professional and clean
> - May be slightly more complex than web2py
> - Template specific language.
> - Feels like more addons and 3rd party support, not sure about this?
> 
> web2py
> - Simpler syntax for doing things (This may be a nice factor, but then it
> does do more 'magic')
> - Unable to find generic views?
> - Not sure how to begin
> - Works with google app engine (not an issue for me, but thats pretty
> cool)
> - Template stuff is pure python with no indentation (this is good!)
> - Interface feels old. LIke pre 2003 way of doing stuff. feels like static
> html pages.
> - No importing of modules, all handled for you (this may not be a great
> thing. I am undecided still...)
> 
> Thanks everyone, i would really appreciate hearing your views.
> 
> Stefan
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
> 
> 

-- 
View this message in context: http://www.nabble.com/web2py-vs-django-tp25360012p25365869.html
Sent from the Python - tutor mailing list archive at Nabble.com.



More information about the Tutor mailing list