support Django legacy db backends and 1.4+ transparently