Added try/except blocks to settings.py importing