Fixed django version check in compat module