17 January 2010 1 comment Web development, Django
This blog post is 13 years old! Most likely, its content is outdated. Especially if it's technical.
If you, like me, have various projects that do things like OAuth on Twitter or Google or you have a development site that goes to PayPal. So you're doing some Django development on http://localhost:8000/foo
and click, for example, to do an OAuth on Twitter with an app you have there. Then Twitter will redirect you back to the live site with which you've set it up. But you're doing local development so you want to go back to http://localhost:8080/...
instead.
Add this bookmarklet: to localhost:8000 to your browser Bookmarks toolbar and it does exactly that.
Here's its code in more verbose form:
(function() {
a = function(){
location.href = window.location.href.replace(/http:\/\/[^\/]+\//,
'http://localhost:8000/')
};
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a,0)
} else {
a()
}
})()
- Previous:
- LastGraph - visualizing your Last.fm usage 8 January 2010
- Next:
- Tip: creating a Xapian database in Python 19 January 2010
- Related by category:
- Fastest way to find out if a file exists in S3 (with boto3) 16 June 2017 Web development
- How to throttle AND debounce an autocomplete input in React 1 March 2018 Web development
- How to create-react-app with Docker 17 November 2017 Web development
- Be very careful with your add_header in Nginx! You might make your site insecure 11 February 2018 Web development
- How to have default/initial values in a Django form that is bound and rendered 10 January 2020 Django, Web development
- Related by keyword:
- Make .local domains NOT slow in macOS 29 January 2018
- uwsgi weirdness with --http 19 September 2019
- Registration and sign-in by email verification 29 April 2013
- Beach volleyball bums 2 August 2012
- Integrate BrowserID in a Tornado web app 22 November 2011
Any way to get this working in Chrome?