webapp2 versus django on GAE

1,580 views
Skip to first unread message

Emmanuel Mayssat

unread,
Dec 4, 2012, 3:35:24 PM12/4/12
to google-a...@googlegroups.com
GAE can be used with webapp2 or django.
I have been using webapp2 for a short while.
I intend to do a 'serious' application (at least for now I am developing the skills!)

I have a prototype running on webapp2.

How easy/difficult is it to migrate from webapp2 to django?
What are the benefits?

Are all the django app running on GAE, or only a subset?
Should I care?

Jason Collins

unread,
Dec 5, 2012, 6:23:26 PM12/5/12
to google-a...@googlegroups.com
We're just about finished the project(s) to move our "serious" applications _from_ Django _to_ webapp2.

webapp2 has a much thinner, less mysterious pipeline than Django. And we prefer Jinja2 templates to Django templates - though I'm sure someone more clever than me could forge Jinja2 on top of Django.

j

Santiago

unread,
Dec 6, 2012, 3:37:39 PM12/6/12
to google-a...@googlegroups.com
Well. I was considering to migrate my Django app to webapp2. How are you using Django? Djangoappengine? Django-nonrel? which version?

Will

unread,
Dec 6, 2012, 5:07:47 PM12/6/12
to google-a...@googlegroups.com
My biggest concern is 'user account management'. Does webapp2 or any
others provide that?

Thanks,

Will
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/oEO0-ptjjxsJ.
>
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.

alex

unread,
Dec 7, 2012, 3:06:09 AM12/7/12
to google-a...@googlegroups.com
webapp2 doesn't provide a 'user account management' thing. App Engine
is something much more than just app instances hosting.

Take for instance built-in Users/authentication service. Using that
you can make it so that any user on the planet with Google Account,
OpenID, OAuth 1 or OAuth 2 (via Cloud Endpoints) can sign in to your
app, w/o you creating an account for them beforehand. All you'd have
to do is something like assign permissions (if there's a permission
concept in your app). So, Django's standalone user account management
doesn't not fully fit into this thing.

You could go ahead and let your users sign in with their twitter,
facebook, yahoo and what have you accounts. Who uses passwords these
days, anyway :)

Will

unread,
Dec 7, 2012, 7:17:00 PM12/7/12
to google-a...@googlegroups.com
Most of my customers are in China. There, facebook and twitter are
completely blocked; gmail, on and off. Yeah, there are still plenty of
people using username/password, haha.

Django's flexible user account framework allows me to plug in my
particular authentication logic very nicely, and gives me the rest for
free. Despite my desire of migrating to light weight and more 'in
fashion' webapp2, I guess I need to stick to Django longer.

Best,

Will

D X

unread,
Dec 10, 2012, 10:42:37 AM12/10/12
to google-a...@googlegroups.com
From my experience, if you have a very small team, some of the "freebies" that come with django can be pretty useful.
If you have a larger team, you can probably many of the freebies on your own.

I'd also say use django-nonrel if using the HRD.  Many of the useful "freebies" you get with django will use the ORM to talk to the database/datastore.  The ORM doesn't work with "pure" django.
If you're using CloudSQL, django is all the more appealing.

Here's an example of what I mean by freebies with Django:
- You can launch a basic commandline shell using "python manage.py shell", where you'll have full access to your datastore etc.  Not too difficult to get set up on your own though.
- Django comes with testing tools that are really useful:
    - You can use "python manage.py dumpdata" to dump your entities to a json file
    - You can use "python manage.py loaddata" to load your entities from json back into your datastore
    - You can use the json file generated by dumpdata as a fixture for testing
- Django comes with a nice test harness that supports fixtures.  If you're not using django, there's other test frameworks like nose-gae that you'll have to set up yourself.  I'm not sure if creating fixtures are as easy as using dumpdata though.
- I used django-social-auth to get user accounts that support facebook and twitter in under an hour.
- I used django-tastypie to get an easy to use REST API in very little time as well.
- Django has a pretty robust caching framework for *rendered* templates.  You don't have to worry about caching a page that doesn't change often.

But don't expect the Django admin to work - it's a bit of a pain to get that working with django-nonrel, since many-to-many relations aren't natively supported well.

Some of the reasons you might want to go with webapp2:
- Much more of the GAE python community is on webapp2.  They're working on little pieces here and there, and projects like gae-boilerplate get you fairly close to the things django-nonrel provides.
- While you save a lot of time coding, you may spend a lot of time hacking django when it doesn't do things exactly the way you want.
- You can't use ndb
- Some pre-built stuff, like tastypie, may not be as efficient as if you built it yourself (I'm finding tastypie makes some unnecessary queries).
Reply all
Reply to author
Forward
0 new messages