Email address validation with Django and Google App Engine Email address validation is a quixotic affair that's sure to end with you sporting a false sense of achievement and your users in tears. Many "better mousetrap" regular-expression-based validation system on the web today are overly strict and reject perfectly valid email addresses.
Beyond regular expressions and other string-based techniques, your options are to check the DNS server (but DNS lookups can fail on occasion) and vrfy the SMTP server (but many SMTP servers turn this off to stop email harvesters). Ultimately, you can actually send an email to the address and see if there are any bounces.
Or, we could just not bother.
That, at least, is the approach that the Google App Engine SDK currently takes.
Both the google.appengine.ext.db.EmailPropery() and the google.appengine.api.mail.is_email_valid() functions only check that a non-empty string instance is passed.
The problem with that is that you really don't want your good friends asdfhdsjkj and asdfghdsj to make regular camio appearances in your lovely database.
It feels to me that the best approach is to accept that we can't truly validate email addresses and instead perform some light validation that doesn't provide false positives while blocking the most obviously non-validating addresses. This seems to be the approach taken by the validation regular expression in Django (email_re in django.core.validators).
Phil Haack has a good article about all this from last year this titled I Knew How To Validate An Email Address Until I Read The RFC in which he quotes several unlikely-looking yet valid email addresses from RFC 3696 (Application Techniques for Checking and Transformation of Names) including such gems like !def!xyz%abc@example.com. I ran the whole list through Django's validator and they all passed.
All this to say that I'm using the Django email validator in my Google App Engine apps and it appears to be working well.
get_stats() Gets memcache statistics for this application. All of these statistics may reset due to various transient conditions. They provide the best information available at the time of being called.
The return value is a dictionary mapping statistic names to associated values. Statistics and their associated meanings: hits: Number of cache get requests resulting in a cache hit. misses: Number of cache get requests resulting in a cache miss. byte_hits: Sum of bytes transferred on get requests. Rolls over to zero on overflow. items: Number of key/value pairs in the cache. bytes: Total size of all items in the cache. oldest_item_age: How long in seconds since the oldest item in the cache was accessed. Effectively, this indicates how long a new item will survive in the cache without being accessed. This is _not_ the amount of time that has elapsed since the item was created.
referenceproperty(a)を持つmodel(A)で reference先のmodel(B)のproperty(b)の値を条件に 検索を行いたいのですがどうすれば出来ますか? db.GqlQuery('SELECT * FROM A WHERE a.b=:1', hoge) みたいな感じで書くとエラーになるようです><
whereに a > 1 and b > 2 のように ">" などの条件は2つ以上記述できない。 (1つしかだめ)
', '.join(self.INEQUALITY_OPERATORS)) BadFilterError: BadFilterError: invalid filter: Only one property per query may have inequality filters (<=, >=, <, >)..
部分一致検索はできない w が unicode のとき q = db.GqlQuery("SELECT * FROM Hoge WHERE fuga>=:1 and fuga<:2", w, w + u"\uFFFD") w が utf-8 のとき q = db.GqlQuery(("SELECT * FROM Hoge WHERE fuga>=:1 and fuga<:2", w, w + "\xEF\xBF\xBD").decode("utf-8")) 自動でデコードされるみたいなので q = db.GqlQuery("SELECT * FROM Hoge WHERE fuga>=:1 and fuga<:2", w, w + "\xEF\xBF\xBD") でもいいみたい
urllib, urllib2, httplib がそのまま使えるようになったっぽっぽっぽ >Google App Engine Blog: SDK version 1.1.9 Released >You can now use the Python standard libraries urllib, urllib2 or httplib to make HTTP requests. >This has been a frequent request on our issue tracker. >We've been working on a set of tools that will make the process of uploading and downloading data from App Engine applications easier. >Today we're excited to announce an early release of our new bulk uploading client. >You can try it out here. Let us know what you think in our Google Group! >Several updates to our datastore, including the automatic generation of single property indexes and the addition of IN and != operators to db.Query. >See the Datastore API docs for more details. >A bunch of additional bugfixes and enhancements, listed in our Release Notes. > ttp://googleappengine.blogspot.com/2009/02/sdk-version-119-released.html
・No more "High CPU Requests"! ・Response deadline raised to 30 seconds. ・Size limits on code files, static files, and requests/responses raised to 10MB!