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.