Restored some lost changes, fixed syntax to use getattr from settings.py