fixed PYTHONPATH adding and exception handling in manage.py