fixed the issues
added the new code to manage.py