I think the best solution is suggested by @T. Stone, but I don't know why just don't use the DEBUG flag in Django. I Write the below code for my website:
if DEBUG:
from .local_settings import *
Always the simple solutions are better than complex ones.