Use APPNAME_ instead of FLASK_.
Varname typo.
PEP8 fixes.
Better APPNAME_-env support.
Whitespace fix.