Move settings code into settings.py