Master PR for #1879

@sefk  please.

The settings part of this is to move the relevant param above the import
of monkeypatch. The models part is just to stop stripping the url.