Reordered condition to avoid calling allow_migrate() if unneeded.
Avoided unneeded calls to state.render() in migrations.
Fixed #23835: Changed circular dependency in DFS to be less infinite
Upgrade django version for oscaro