Rearranging settings.py code