Archive for the ‘AppEngine’ Category

Google AppEngine adds blacklists

Friday, May 28th, 2010

Not sure when this got added, but you can now see the ip’s most accessing your app, and hopefully you can block someone from using up your quota.

http://code.google.com/appengine/kb/general.html#blacklists

Using django.contrib.sitemaps on AppEngine

Monday, May 17th, 2010

If you use Google AppEngine and want to use the sites and sitemaps contrib apps you can use this modified version of the google-app-engine-django helper here: http://code.google.com/p/dherbst-app-engine-django/wiki/Sitemaps

Amazon steps up to AppEngine

Thursday, May 28th, 2009

Google’s AppEngine was quite promising from the start.  Automatic scaling and load balancing without having to think about the administrative side is extremely nice.

But that’s about it.  There’s a couple of things which make AppEngine a bit cumbersome to recommend for a new application, all of which are well served by Amazon EC2+ELB+ES:

  1. Lack of SSL for your custom domain
  2. Can’t use many django pluggables out of the box because of RDMS dependencies
  3. Some would say naked domains, but ELB can’t do naked domains either, so this is a wash.
  4. Can’t use other off the shelf software, like wordpress, etc.

Don’t get me wrong, I really like AppEngine, and for small apps I’m going to stick with it because of:

  1. Cost – the free instance can’t be beat.  You’re at an automatic $100/month with EC2.
  2. Little to no infrastructure admin needed – mainly just some DNS.
  3. You can run Django 1.0 with either app-engine-patch, or the django-helper.

I can’t wait for AppEngine to gain ground

Thursday, January 8th, 2009

Over the past eight months or so I’ve worked on a variety of web applications. A bunch of them have been using Django, and I’m extremely happy with Django. It’s definitely the quickest, easiest way to get an application out the door.

I’ve been splitting the apps between webfaction, amazon’s EC2, and Google App Engine. By far, the easiest to work with is AppEngine. I can safely delegate almost all of the operations aspect to Google. Backups are a bit hard, but once you resign yourself to scripting it all out, everything just works.

Webfaction comes in a close second – it’s main problem is that it costs money. You can pretty much just code and deploy with it. With AppEngine you are forced to do everything with Django – so using wordpress or some other app is not an option. Webfaction gives you pretty much what you need.

EC2 is a whole other beast altogether. If you want almost complete control, go with EC2. The biggest stumbling block for me is relearning all the system operations stuff I haven’t had to do since my grad school days putting together linux and freebsd clusters.

What’s my point? Well this:

AppEngine – you concentrate on building your app. Operations is largely left to Google. Note, you should definitely use app-engine-patch, it makes Django 1.0 very easy to use on AppEngine.

Webfaction – you work on your app most of the time, you have to dust off some apache configuration skills every once in a while when you need to integrate some other app in the mix.

Amazon EC2 – Work on your app mostly, but you better be prepared to learn about:
nginx, haxproxy for load balancing
apache configuration and security in detail
database configuration, security, and backups in detail
EC2 tools for starting/stopping/replicating server instances

My AppEngine apps are small right now, but they require the least amount of work by far. I wish I could do everything on AppEngine.

Google App Engine – django login_required Google Accounts

Tuesday, September 9th, 2008

I like to use Google Accounts with App Engine and django. The django login_required decorator depends on the django auth model – so I rewrote it for use with Google Accounts authentication.

I’m not sure if it is better to cache the create_login_url or not, but this works well enough for now.

from django.http import HttpResponseRedirect

from google.appengine.api import users

def login_required(fn):
    """ checks to see if the user is logged in, if not, redirect to login """

    def _dec(view_func):
        def _checklogin(request, *args, **kwargs):

            user = users.get_current_user()
            if user:
                return view_func(request, *args, **kwargs)

            else:
                return HttpResponseRedirect(users.create_login_url('/'))
        _checklogin.__doc__ = view_func.__doc__

        _checklogin.__dict__ = view_func.__dict__

        return _checklogin

    return _dec(fn)