SOC2010: Develop Pykata

1 view
Skip to first unread message

David MacQuigg

unread,
Mar 23, 2010, 5:37:37 PM3/23/10
to pyw...@googlegroups.com
Abhishek Mishra wrote:
> Hi David,
>
> Agreed, a lot is coming to my mind as to kind of features possible for
> PyKata. I think we can classify features as core and extras.
> As for the frameworks, I'm a little more familiar with web2py than
> django, thanks to some frontend work I did for sahanapy, which uses
> web2py. It seems web2py has less friction to GAE.
> I'm going through opinions expressed by people and also trying out the
> Poll app tutorial of django itself to get a feel.
> After I'm done getting a taste of both, I think I would be able to
> give a just comment.
> As of now web2py does seem to be reducing new contributor friction
> too. I'll get back to you with an opinion and more details soon.
>
> Thanks,
>
> Abhishek
>
> On Tue, Mar 23, 2010 at 9:06 AM, David MacQuigg
> <macq...@ece.arizona.edu> wrote:
>
>> Hello Abhishek,
>>
>> Welcome to PyKata. Sorry for the delay in responding to your original
>> email. I've been out of town for four days. I can see you have excellent
>> experience in developing websites, and I think you would be well qualified
>> to do this as a GSoC project. Andy is the mentor on that project, but I
>> will be available should you need any additional help with project
>> management issues, getting access to the SVN repository, etc.
>>
>> It's good to think about the long-range possibilities for what we might do
>> with this site, but perhaps we should have a discussion with Andy on which
>> direction we want to go right now. I've been focused on short-term issues,
>> like getting the formatting bug fixed. Andy may be more concerned about
>> getting together a plan for the whole summer, so we can get funding under
>> GSoC. Perhaps we should do the summer planning first, then drop back and
>> finish the current site, with limited features.
>>
>> My worry is that we spend an awful lot of time developing grand plans, but
>> never get the first revision of the actual site finished to the point where
>> we can start encouraging teachers to contribute problems. Right now the
>> format provided by the Django TextArea widget is so bad, it is an
>> embarrassment. See the problem "list123FAIL" for example
>> http://pykata.appspot.com/code/1/ See also the Issue Tracker and Source
>> Code at http://code.google.com/p/pykata/.
>>
>> This problem has stumped every student who has gotten this far. That led me
>> to question the choice of Django over a simpler framework like web2py, and
>> Sean is now looking into switching the project from Django to web2py. None
>> of us knows Django, so your opinion on that choice would be helpful. We
>> need a framework with enough features that we can do a site like
>> JavaBat.com, but simple enough that successive generations of student web
>> developers can jump right in and not have to re-write everything, when they
>> just want to add one feature.
>>
>> I've spent several years as a program manager for Cadence Design Systems, a
>> large software company. That experience leads me to be very conservative in
>> making commitments on software development. I've seen big project mushroom
>> out of control, wasting huge amounts of programmer time and company
>> resources, and never getting finished. At the very least, I will insist
>> that there be milestones, and that we all agree we have reached a milestone
>> before spending significant time on the next.
>>
>> I've sent you an invitation to join our Google group (still called PyWhip).
>>
>> -- Dave
>>
>> ************************************************************ *
>> * David MacQuigg, PhD email: macquigg at ece.arizona.edu * *
>> * Research Associate phone: USA 520-721-4583 * * *
>> * ECE Department, University of Arizona * * *
>> * 9320 East Mikelyn Lane * * *
>> * http://purl.net/macquigg Tucson, Arizona 85710 *
>> ************************************************************ *
>>
>>

Abhishek Mishra

unread,
Mar 24, 2010, 5:03:06 AM3/24/10
to PyWhip
Looking for more comparisons b/w web2py and django is GAE perspective,
I came across the following -


1. http://stackoverflow.com/questions/76809/anyone-out-there-using-web2py/
(an old post of 2008 though)

- web2py interfaces a many databases.
- I like the traceback logging feature of web2py, whenever
anything goes wrong,
it is logged as a ticket and can be viewed later.
In my experience with web2py, this helps when when something
goes wrong in the ajax requests,
though nothing comes up into the fontend, but you can still
debug using error tickets generated.
- Web2Py claims to be user friendly. It allows pure python in
views,
which means we don't have to do much learning on views too,
though I loved django templating while doing lenny.madetokill.com

In web2py views we can have things like -
{{if 'page' in request.vars:}}
{{try:}}
{{if totalpages <> 1:}}
{{=search_btn}}
<p>&nbsp;</p>
{{pass}}
{{except:}}
.
.

- Another plus point - web2py programs often run on GAE unmodified
http://stackoverflow.com/questions/76809/anyone-out-there-using-web2py/1325446#1325446

- The main dev defends it actively
http://www.reddit.com/comments/6kfye/web2py_or_django_which_would_you_use_for_a_new_app
!!

- Another comparison in support of web2py http://blog.quadraforte.com/?p=14


Coming to another post on a python-tutor mailing list -
http://www.mail-archive.com/tu...@python.org/msg37715.html

- Importing your own modules to a controller was what I too had
some trouble with - http://paste.pocoo.org/show/186167/ http://is.gd/aVRoZ
I didn't like the exec way of importing your own modules.

- "Not sure how to begin" -- this happened to me too, since I
worked on frontend, I could manage somehow.
Also it took time to figure out which place would be
appropriate to edit, while working on sahanapy's current menu -
http://demo.sahanapy.org/
When it comes to MVC, I believe things related to views should
strictly remain in views, but in web2py, I could see
a lot of A("/foo/bar", _class="beep") and such functions that
generate html on controller/module level.
But then I believe a lot of custom code has gone into sahanpy.


Some opinions on yesterday's django poll tutorial tryout, I did not
try deploying it to gae though -

- Admin interface looks very professional and simplified.
- django shell is a great tool, conventionally we notice lack of
interactivity with database. commonly seen in php+mysql setups.
- The django poll tutorial was explained with great details.
- App engine support is a little confusing, two ways - http://is.gd/aVUtq
, some complaints - http://is.gd/aVU7Q
Given that web2py claims appengine deployment without much
change in code, it seems more attractive.

With a framework like web2py or django, we would have the freedom to
move out of Appengine to any other infrastructure if needed at all.
Another post by Massimo seems convincing
http://aspn.activestate.com/ASPN/Mail/Message/edu-sig/3823111
"A lot of Applications bundled with Django, most notably admin, auth,
and sessions will not work." --->> http://www.42topics.com/dumps/django/docs.html

Having read all this, I will give it a shot to web2py today, just a
simple app and try deploying it to appengine to get a feel. Massimo
has also put up django poll example equivalent on vimeo - http://vimeo.com/6507384

Coming back with some more opinion,

regards,
Abhishek

> >> Code athttp://code.google.com/p/pykata/.


>
> >> This problem has stumped every student who has gotten this far.  That led me
> >> to question the choice of Django over a simpler framework like web2py, and
> >> Sean is now looking into switching the project from Django to web2py.  None
> >> of us knows Django, so your opinion on that choice would be helpful.  We
> >> need a framework with enough features that we can do a site like
> >> JavaBat.com, but simple enough that successive generations of student web
> >> developers can jump right in and not have to re-write everything, when they
> >> just want to add one feature.
>
> >> I've spent several years as a program manager for Cadence Design Systems, a
> >> large software company.  That experience leads me to be very conservative in
> >> making commitments on software development.  I've seen big project mushroom
> >> out of control, wasting huge amounts of programmer time and company
> >> resources, and never getting finished.  At the very least, I will insist
> >> that there be milestones, and that we all agree we have reached a milestone
> >> before spending significant time on the next.
>
> >> I've sent you an invitation to join our Google group (still called PyWhip).
>
> >> -- Dave
>
> >> ************************************************************     *
> >> * David MacQuigg, PhD    email: macquigg at ece.arizona.edu   *  *
> >> * Research Associate                phone: USA 520-721-4583   *  *  *
> >> * ECE Department, University of Arizona                       *  *  *
> >> *                                 9320 East Mikelyn Lane       * * *

> >> *http://purl.net/macquigg       Tucson, Arizona 85710          *
> >> ************************************************************     *

Abhishek Mishra

unread,
Mar 24, 2010, 5:32:33 AM3/24/10
to PyWhip
Some more opinion from a friend who contributes to sahanapy -

<lifeeth> Web2py is good. But it seems to be a PITA in terms of
scaling
Mar 23 11:12:19 <lifeeth> Web2py = faster to deploy and customize
Mar 23 11:12:23 <lifeeth> and easier to maintain
Mar 23 11:12:27 <lifeeth> but it comes with its price
Mar 23 11:14:01 <lifeeth> :D
Mar 23 11:14:32 * devilsadvocate (~devi...@202.3.77.159) has joined
#hackers-india
Mar 23 11:15:13 * ChanServ sets channel limit to 14

While doing some work on sahanpy, I also came across the global
objects used in web2py, request and response. It seems they're each
individually very huge (as in when I printed them, it took around
200-300 lines to display) and are passed from layer to layer every
time a request occurs.

I wonder how good would be web2py vs django vs webapp in terms of
performance.

I had a tough time on gae once due to bad design and unconventional
way of pulling data -
http://blog.ideamonk.in/2009/09/app-engine-is-it-enough.html
http://blog.ideamonk.in/2009/09/python-who-squeezed-all-bandwidth.html


On Mar 24, 2:03 pm, Abhishek Mishra <ideam...@gmail.com> wrote:
> Looking for more comparisons b/w web2py and django is GAE perspective,
> I came across the following -
>

<snip>

David MacQuigg

unread,
Mar 24, 2010, 11:41:39 AM3/24/10
to PyWhip
On Mar 24, 2:03 am, Abhishek Mishra <ideam...@gmail.com> wrote:
>
> Having read all this, I will give it a shot to web2py today, just a
> simple app and try deploying it to appengine to get a feel. Massimo
> has also put up django poll example equivalent on vimeo -http://vimeo.com/6507384

An interesting comparison might be to include a simple text area
widget, like the kind we are having trouble with in Django, and see if
you can do some simple formatting. A safe subset of HTML would be
nice, but simple monospaced text, preserving all line breaks and
spaces, would be adequate.

We might try posting a question to the Django discussion group. It
may be that we are just overlooking something simple.

I would say the major considerations in choosing our web framework
should be:
- Ease of use for non-experts who may be maintaining our site later.
Can we jump right in and figure things out? I'm having trouble
understanding what we have now.
- Helpfulness of the community on a question or problem. Django has a
larger community, but the web2py community is very active.
- Sufficient features to support anything we are likely to need.

Abhishek Mishra

unread,
Mar 24, 2010, 3:48:32 PM3/24/10
to pyw...@googlegroups.com
Hi David,

Just tried out web2py on appengine - http://hello-poll.appspot.com
http://github.com/ideamonk/hello-poll

Some opinion -

1. Development of the app was pretty easy, after reading web2py book I
could get through easily http://web2py.com/book/default/section/0/0,
encountered a few doubts when deploying to GAE though -
http://is.gd/aWTTT http://is.gd/aWTVQ

2. I loved the SQLFORM function from gluon, helps me create forms very
quickly for taking user input..

3. I liked the data validation on view level too. It automatically
picks from db.py's schema definitions, eg -
db.define_table('poll',
Field('question', length=200, requires=IS_NOT_EMPTY()),
Field('pub_date','datetime', default=request.now, writable=False))

IS_NOT_EMPTY() -> is really active on all levels -
http://twitpic.com/1anwaq

4. Deployment on GAE was a cakewalk. modify app.yaml in web2py directory.
In applications/ make a link of your application as 'init', test
locally using devappserver, and deploy as usual appcfg.py.

5. I worked in the web admin interface of web2py. Its pretty well made
to edit things quickly - http://twitpic.com/1alnu8 though the edit
area widget here too looks odd on firefox 3.6 and chrome's latest
build - http://twitpic.com/1anwrt < very confusing sometimes with
transparent chars. I think spoj.pl people too use same editor
component and have got it working fine.
In django I could easily use eclipse - http://twitpic.com/1ahhqb
and autocomplete, etc would work well.
Not required, but web2py doesnt integrate well with eclipse, etc
http://twitpic.com/1anueo given its architecture which uses some
global objects - request, response, db etc. <- this has some
advantages too.

6. Finally working with web2py was very very easy and quick to get the
webapp done. The book and examples seem sufficient though sometimes I
had to dig into
http://www.web2py.com/examples/static/epydoc/gluon.sqlhtml.SQLFORM-class.html
to understand what goes behind. In case of django or webapp framework,
the documentations are more to the point and nicely organized.

Performance issues...

So I really wanted to see how well would web2py perform on GAE. I was
suspecting it to act a little slow, as it does a lot for each request
made.
I wrote a small script to make random votes -
http://paste.ha.ckers.in/plain/163002 and made it run from three
locations in India. It creates 40 threads that try opening different
urls on hello-poll app.

As we can see cumulative vote hits -
http://hello-poll.appspot.com/polls/default/answer?id=43001
3164+2431 = 5595
http://hello-poll.appspot.com/polls/default/answer?id=27001
= 2432
Total
8027

Thats about 8k hits and this is the status of the quotas -
http://twitpic.com/1anzng http://twitpic.com/1anznw
http://twitpic.com/1anzla . The changes did happen rapidly -
http://www.youtube.com/watch?v=aGGiFfnBNBM
Definitely a lot of datastore api calls too - 82869 of 10368000

So as of now I believe its very much possible for anyone to finish the
free quota of hello-poll in 1-2 hrs of time. I've noticed slow speed
on running instances of sahanapy on 256mb ram VPSes. Would we consider
web2py as a good choice in this light?
Some people suggest to run web2py with Cherokee (a very fast webserver
written in pure C) - http://is.gd/aX1ND <- but then overhead of
infrastructure management would be on our heads, while on GAE things
are well managed.

Definitely its very good as a rapid webapp framework. Has got many
features, does many obvious things beforehand to save time, provides a
nice structure to organize code, views, static files. Sahanapy has
been using it in production for haiti and other projects. But speed
and resource utilization / scalability is where web2py seems to be a
little low. Maybe 8k hits were too low but then I'm sure the real
PyKata once it gains popularity would receive more hits than that per
day.

However I'm not sure of django in terms of performance on gae as of
now. Shall we test it too?
-------------------------------------------------------------------

Ah looks like I spent much of the time doing that. David, I'll look
into editor component soon. Many people seem to be using
http://www.cdolivet.com/index.php?page=editArea&sess=7ee36657f9a0b33e630e05526e793058
Though its implementation in PyKata, web2py admin and the ones on its
own sample page don't seem to be working fine on my browsers.
Sometimes the text becomes pretty confusing. Woops, its implementation
on spoj too isn't looking perfect - http://twitpic.com/1ao296 .
Codality too seem to be using same component, works fine on firefox
http://twitpic.com/1ao2tp but lacks on Chrome
http://twitpic.com/1ao2sw . I think there's something with the
font-family selection here. A monospaced font is a must. I'll look
into this issue soon.

We should get some opinion from django group too. As per performance
I'm really keen on testing django on gae now.

Django community is huge, at any time there are ~500 people on irc to
interact to. While web2py responses are very quick, but then there are
only a few people responsible for that, mostly the main developer.
As per working with GAE's default webapp framework, thats a place
where developers write most of the stuff or take help of django got
get an edge. Pure GAE is rather more simpler and easy to write from
scratch.

Django on other hand also seems to be a more rocksolid foundation
given the number of successful applications written in it. I recently
came across one - http://www.reviewboard.org/ and was quite impressed.

I don't know where this particular discussion on frameworks is going,
I see more and more confusion. Perhaps we should ask more.

I better start concentrating on segregating essential features and
workflow ideas now!

Let me know what django group has to say if you post them.

Thanks,
Abhishek

> --
> You received this message because you are subscribed to the Google Groups "PyWhip" group.
> To post to this group, send email to pyw...@googlegroups.com.
> To unsubscribe from this group, send email to pywhip+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pywhip?hl=en.
>
>

Abhishek Mishra

unread,
Mar 24, 2010, 4:03:01 PM3/24/10
to pyw...@googlegroups.com
Its quite good to know that all I had to write was 40 lines of
controller code, 10 lines in db.py to define tables, and rest was css
+ html work.

On Thu, Mar 25, 2010 at 1:18 AM, Abhishek Mishra <idea...@gmail.com> wrote:
> Hi David,
>
> Just tried out web2py on appengine - http://hello-poll.appspot.com
> http://github.com/ideamonk/hello-poll

<snip>

Abhishek Mishra

unread,
Mar 24, 2010, 4:41:05 PM3/24/10
to pyw...@googlegroups.com
Some opinion from a django developer -

From: Viksit Gaur <vik...@gmail.com>
Date: Thu, Mar 25, 2010 at 2:02 AM
Subject: Re: django vs web2py
To: Abhishek Mishra <idea...@gmail.com>

I've used Django for few years now, and if tuned well, its performance
is superfast. The community support is huge, as are the number of
features available. Django on EC2 is what I use. One issue with GAE is
data non portability - if you did want to shift, you'd have a hard
time doing so.

That said, GAE Django integration is excellent as well (uboggle.appspot.com)

- Viksit

Abhishek Mishra

unread,
Mar 24, 2010, 9:27:13 PM3/24/10
to pyw...@googlegroups.com
Another comment from a django eveloper over django vs web2py question...


---------- Forwarded message ----------
From: Lakshman Prasad <scorp...@gmail.com>
Date: Thu, Mar 25, 2010 at 3:21 AM
Subject: Re: SOC2010: Develop Pykata
To: Abhishek Mishra <idea...@gmail.com>


I personally use and love django, all the time. But then, I build
complex web applications, with many apps, models and so many pages and
functionalities.
Django is useful in my case because, it comes built in with all the
needed mechanisms to work around the complexity: signals, forms,
formsets, friendly api's. Most importantly tho' it has an awesome
community and excellent documentation.
Django is fairly easy to start with, but I often hear that the
learning curve is steep (I agree.) once you get a simple app up, to
getting a complex app.
Django on appengine, there is only a patch project right now, and I
wouldn't call that production ready at all. However there is steady
progress and I believe members of the core are going to look into the
non relational support in the coming release or the next, which may be
like in 6 months easily. Then I'd wholeheartedly recommend to use
django on app engine and put my money (or time) on that.
However, if your team has an expert django developer, you could
install django and use only the relevant parts you require, like say
forms, signals etc. for the ORM parts, you could use the standard
webapp framework. It depends on the nature of the site you are going
to develop. This is going to be a good way, if the site has many
social features, and you want to migrate to django once it has a good
non relational support.
I haven't used web2py myself ever, but I find a general dislike of
that framework in the community. It supposedly uses many
"anti-patterns". See this thread:
http://www.reddit.com/r/programming/comments/8pijx/web_development_with_python_made_easier_then_ever/
So if I were to choose a framework to work on appengine right now, I
would use the built in web app framework directly, and choose the
appropriate relevant libraries for each of the kind of task needed.
But, apparently there is such a framework. I recently came across
Glashammer: http://stackoverflow.com/questions/2283616/opinion-about-glashammer-app-engine-web-framework
that uses some of the best in the python industry packages
individually.
Check it out and let me know what kind of site are you going to build.
If the site doesn't really require too many "social" features, you may
be good with the built in Web app framework itself.

David MacQuigg

unread,
Mar 24, 2010, 9:32:44 PM3/24/10
to pyw...@googlegroups.com
Hi Abhishek,

Excellent work! You have done quite a lot of testing in very little time.

As for the speed of web2py vs Django, it is my understanding that GAE
will automatically replicate the app to more servers if the response
slows due to too many hits on just a few servers. I think the other
considerations we discussed, ease of use, etc, are more important. When
we get thousands of students using PyKata, we will probably have little
difficulty getting some funding to optimize performance, it that is
required.

It looks like it won't take you long to replicate what we have now, but
using web2py. We have a test branch on our SVN repository you can use,
if you need to experiment. I can switch the GAE from one branch to
another if we decide to use the alternative.

Perhaps rather than more testing (we know we can get the job done with
either framework), it might be more productive right now to get some
ideas up on our website for the Google folks to look at when they are
deciding who gets selected for GSoC. I understand it is getting quite
competitive, and we have only a few weeks before the final decisions are
made. Graphics will have more impact than long text descriptions.
These can be static pages. We can add the scripting later. Take a look
at http://javabat.com for ideas on teacher feedback, etc.

-- Dave

Abhishek Mishra

unread,
Mar 24, 2010, 9:37:34 PM3/24/10
to pyw...@googlegroups.com
Cool,

Yes I agree we missing out on the real task. /me runs for college for now.
Get back to you with an idealist and some mockups I had in mind...

Thanks,
Abhishek

Reply all
Reply to author
Forward
0 new messages