Replacement for classify.py and migrated db operations from raw sql to
django ORM.