Rewrite as a Django app