This script is very basic: it does one thing. Connect to it's root and it will log your IP if it has never seen it before. Connect to /logs, and it will show a list of unique IPs within the server storage. I can't take 100 percent credit for it. I grabbed it off of Stack Overflow, modified it to actually run on App Engine, and changed the save mechanism to prevent duplicate entries. This thing is so simple it's shocking; considering how many different super-elaborate ways I can waste money and time doing the same thing. I use it to keep track of my ssh IP. I run wget on my App Engine address every ten minutes. Can this be improved? Are there any flaws which may compromise its efficiency?helloworld.pyfrom google.appengine.ext import webappfrom google.appengine.ext.webapp.util import run_wsgi_appfrom google.appengine.ext import dbclass Log(db.Model):    access_time = db.DateTimeProperty(auto_now_add=True)    ip_address = db.StringProperty()class MainPage(webapp.RequestHandler):    def get(self):        ip = self.request.remote_addr        log = Log()        logs = Log.all()        is_new = True        for log in logs:                if ip == log: is_new = False        if is_new:                log.ip_address = ip                log.put()        self.response.headers['Content-Type'] = 'text/plain'        self.response.out.write('Logged your visit from ip address %s' % ip)class LogPage(webapp.RequestHandler):    def get(self):        logs = Log.all()        self.response.headers['Content-Type'] = 'text/plain'        self.response.out.write('Ip addresses: ')        for log in logs:            self.response.out.write(log.ip_address + ',')app = webapp.WSGIApplication([('/', MainPage), ('/logs', LogPage)],                                     debug=True)app.yamlruntime: python27api_version: 1threadsafe: truehandlers:- url: /.*  script: helloworld.appP.S. I'm pretty sure this isn't violating any contracts or agreements. Tell me if I'm wrong about that.Credit: Get IP address in Google App Engine + Python
Dynamic IP Notification Using Google App Engine
python;google app engine
LintPEP 8 recommends two blank lines around class definitions.  Indentation should be consistently 4 spaces  an important convention in Python, where indentation matters a lot.log = Log() is pointless.DatabaseA more Pythonic way to write thislogs = Log.all()is_new = Truefor log in logs:        if ip == log: is_new = False would be is_new = ip not in Log.all().But your code wouldn't even work, since an IP address would never be equal to a db.Model object!It also doesn't scale well, since it doesn't take advantage of the datastore's capabilities.  You should be using a query like this:Logs.all().filter('ip_address =', ip).run(limit=1)