Shouldn't SSH_NFSEN_CREDENTIALS (and others config variabled) be added to app.py (as None) - then there is no need to test if settings hasattr XXX.