Fixed #22738 -- made finer distinctions for when Boolean is not detected on Oracle

Thanks Claude Paroz for partial fix and Simon Charrette for review
Fixed git blunder, refs #22738
Updated comment about Python issue
Fixed #23436 -- Made BASE_DIR absolute in settings template.

This ensures consistency between Python 3.4+ and earlier versions.

Thanks Harry Percival for the report.
Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.

Thanks Collin Anderson for the review.
Fixed #16731 -- Made pattern lookups work properly with F() expressions