support for older Django versions, more stable code