I'm working on a Project where on certain places I need absolute URL's, in development mode I need the port 8000 added to any absolute url.
This piece of work, took me some time to figure out. Couldn't find something similiar on the net, it's based on Code from the Python urlparse module.
You can change the "settings.PORT" part to "settings.DEBUG == True" if you like, and so on.
META: replace parameters in URL, edit parameters in URL, edit URL, urlparse