Ports middleware to Django, and adds repo sync view