Moved models to a module of its own.
Use the 'hashlib' module instead of the deprecated 'sha' one. Extracted function that creates the hash.