def check_password(environ, username, password):

    UserModel = auth.get_user_model()
    # db connection state is managed similarly to the wsgi handler
    # as mod_wsgi may call these functions outside of a request/response cycle
    db.reset_queries()

    try:
        try:
            user = UserModel._default_manager.get_by_natural_key(username)
        except UserModel.DoesNotExist:
            return None
        if not user.is_active:
            return None
        return user.check_password(password)
    finally:
        db.close_connection()
Authenticates against Django's auth database
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/auth/handlers/modwsgi.py/check_password