using m2crypto for random bytes, updated for django 1.7