Stop the Django 5.0 press: Move `URLField.assume_scheme` change from deprecation to hard-cut

Amazing, thank you @felixxm! I think this is a very good compromise :clap:

I have published my updated blog post now, covering the transitional setting as well:

4 Likes

Firefox, Safari, and Chrome/Edge on my machine all have built-in validation for <input type="url"> that requires a scheme before allowing users to submit a form.

Why is Django assuming a scheme at all vs doing validation similar to browsers (“Please enter a URL”) to catch incoming data from non-browser sources? When I first saw mention of this change in the release notes, I didn’t realize Django had been assuming “http://” and at first thought all of our forms with URL fields might have been accepting scheme-less URLs this entire time until I actually tested one such form. There isn’t a straightforward way I’m aware of to test assume_scheme and the transitional setting in a browser.

The validation isn’t only for “non form” sources. It also applies to fields where the widget or template have been changed.

But thanks for pointing this out. We all missed it. I think it’s more evidence that a hard cut would have not caused much trouble. I will update my blog post with a note here to even more strongly recomend the transitional setting.

1 Like