Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X
Post

Email Validation in Google App Engine

My current project is building a mobile website for Japanese cellphones that can stand about 10-20k hits within an hour without getting completely trashed.  Admittedly, this isn’t exactly the easiest thing in the world to do, but Google App engine makes it a lot easier.  In the process, I had to brush up on my Python, and in particular, email validation.

The obvious way to deal with email validation is to use google’s “mail.is_email_valid” function.  Unfortunately, this seems to return true as long as you have a string, as it mentions on Aral Balkan’s helpful post on the subject.  I had to dig a little more to find out how to use mail_re; here’s the code for anyone curious.

from django.core.validators import email_re
print (email_re.match(‘test_email@fakedomain.com’) != None)
print (email_re.match(‘bademail’) != None)
Seems to work properly.