Making the scan command work from manage.py