UrlField cannot be used with relative URLs
|Reported by:||notanumber||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.0|
|Severity:||Keywords:||url urlfield relative|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
models.URLField and forms.URLField cannot be used with relative URLs. This can be a problem when developing a site on domain and then deploying to another.
In our instance, we are trying to pull data from the "live" server to our "qa" servers, but of course, all the urls entered in URLFields are now broken because they still point to the live server.
Ultimately, URLField should support the use of relative URLs. Couldn't it be assumed and (possibly tested using verify_exists=True?) that a URL that does not contain http:// is relative.