Django redirect interrupted by browser?How do you disable browser Autocomplete on web form field / input tag?How to manage a redirect request after a jQuery Ajax callWhat is the maximum length of a URL in different browsers?How do I redirect to another webpage?How do I make a redirect in PHP?How can I redirect and append both stdout and stderr to a file with Bash?Why my Django app on heroku displays Server Error (500) for default page?while running command Heroku logs Errros are belowSite is crashed at the time of deploy an app on herokuHeroku: “Process exited with status 127” after deploying python Django App

How to deal with administrative duties killing the research spirit?

Is there an easy way to index by a binary vector / mask?

Has there ever been a cold war other than between the U.S. and the U.S.S.R.?

Is it possible that Curiosity measured its own methane or failed doing the spectrometry?

What's the big deal about the Nazgûl losing their horses?

How serious is plagiarism in a master’s thesis?

Chess problem: Make a crossword in 3 moves

Did Stalin kill all Soviet officers involved in the Winter War?

Do intermediate subdomains need to exist?

Should I hide my travel history to the UK when I apply for an Australian visa?

Why did the "Orks" never develop better firearms than Firelances and Handcannons?

What is meant by perfect, imperfect consonance and dissonance?

How can I define a very large matrix efficiently?

Does Evolution Sage proliferate Blast Zone when played?

Can a wizard delay learning new spells from leveling up to learn different spells later?

About opening an LLC with little to report in the beginning

Using Sed to add counter to keyword

What are the differences of checking a self-signed certificate vs ignore it?

Interview Question - Card betting

What is the addition in the re-released version of Avengers: Endgame?

Does a multiclassed wizard start with a spellbook?

Does the Defensive Duelist feat stack with the AC calculation from the Warforged's Integrated Protection trait?

What is exact meaning of “ich wäre gern”?

Platform Event Design when Subscribers are Apex Triggers



Django redirect interrupted by browser?


How do you disable browser Autocomplete on web form field / input tag?How to manage a redirect request after a jQuery Ajax callWhat is the maximum length of a URL in different browsers?How do I redirect to another webpage?How do I make a redirect in PHP?How can I redirect and append both stdout and stderr to a file with Bash?Why my Django app on heroku displays Server Error (500) for default page?while running command Heroku logs Errros are belowSite is crashed at the time of deploy an app on herokuHeroku: “Process exited with status 127” after deploying python Django App






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have a very simple view that is purposed to track a user's click and redirect them to an external page:



def redirect_view(request, uu_id):
my_model = MyModel.objects.get(uuid = uu_id)
my_model.clicked_link = True
my_model.save()
return redirect('https://www.some-other-site.com')


For about half of the users that interact with this view it works perfectly! Our logs show a 302 response and then nothing further from the user.



For the other half of our users they are strangely redirected to the base url of our site in http, then because we have SECURE_SSL_REDIRECT = True they are redirected to https, and finally because they are not authenticated they are redirected for authentication.



Our logs for this type of user look something like this:



Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/redirect-url" host=mysite.com request_id=123 fwd="..." dyno=web.1 connect=0ms service=25ms status=302 bytes=268 protocol=https 
Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=456 fwd="..." dyno=web.1 connect=1ms service=3ms status=301 bytes=262 protocol=http
Feb 21 10:04:52 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=789 fwd="..." dyno=web.1 connect=0ms service=2ms status=302 bytes=360 protocol=https


There is nothing in our code that would suggest a redirect to our base url so my only thought is that they have some sort of browser setting that limits external redirects.



Could this in any way be caused by Django?
If this is not a Django issue what is causing it? and what would be a good work-around?










share|improve this question
























  • I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

    – Louis
    Mar 28 at 17:14











  • @Louis This is all interpretation. Do you have any idea of what else could cause this?

    – grrrrrr
    Mar 28 at 21:46











  • I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

    – Mario Orlandi
    Mar 29 at 7:40











  • @MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

    – grrrrrr
    Mar 29 at 13:10











  • Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

    – Mario Orlandi
    Mar 30 at 7:23

















0















I have a very simple view that is purposed to track a user's click and redirect them to an external page:



def redirect_view(request, uu_id):
my_model = MyModel.objects.get(uuid = uu_id)
my_model.clicked_link = True
my_model.save()
return redirect('https://www.some-other-site.com')


For about half of the users that interact with this view it works perfectly! Our logs show a 302 response and then nothing further from the user.



For the other half of our users they are strangely redirected to the base url of our site in http, then because we have SECURE_SSL_REDIRECT = True they are redirected to https, and finally because they are not authenticated they are redirected for authentication.



Our logs for this type of user look something like this:



Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/redirect-url" host=mysite.com request_id=123 fwd="..." dyno=web.1 connect=0ms service=25ms status=302 bytes=268 protocol=https 
Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=456 fwd="..." dyno=web.1 connect=1ms service=3ms status=301 bytes=262 protocol=http
Feb 21 10:04:52 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=789 fwd="..." dyno=web.1 connect=0ms service=2ms status=302 bytes=360 protocol=https


There is nothing in our code that would suggest a redirect to our base url so my only thought is that they have some sort of browser setting that limits external redirects.



Could this in any way be caused by Django?
If this is not a Django issue what is causing it? and what would be a good work-around?










share|improve this question
























  • I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

    – Louis
    Mar 28 at 17:14











  • @Louis This is all interpretation. Do you have any idea of what else could cause this?

    – grrrrrr
    Mar 28 at 21:46











  • I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

    – Mario Orlandi
    Mar 29 at 7:40











  • @MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

    – grrrrrr
    Mar 29 at 13:10











  • Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

    – Mario Orlandi
    Mar 30 at 7:23













0












0








0








I have a very simple view that is purposed to track a user's click and redirect them to an external page:



def redirect_view(request, uu_id):
my_model = MyModel.objects.get(uuid = uu_id)
my_model.clicked_link = True
my_model.save()
return redirect('https://www.some-other-site.com')


For about half of the users that interact with this view it works perfectly! Our logs show a 302 response and then nothing further from the user.



For the other half of our users they are strangely redirected to the base url of our site in http, then because we have SECURE_SSL_REDIRECT = True they are redirected to https, and finally because they are not authenticated they are redirected for authentication.



Our logs for this type of user look something like this:



Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/redirect-url" host=mysite.com request_id=123 fwd="..." dyno=web.1 connect=0ms service=25ms status=302 bytes=268 protocol=https 
Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=456 fwd="..." dyno=web.1 connect=1ms service=3ms status=301 bytes=262 protocol=http
Feb 21 10:04:52 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=789 fwd="..." dyno=web.1 connect=0ms service=2ms status=302 bytes=360 protocol=https


There is nothing in our code that would suggest a redirect to our base url so my only thought is that they have some sort of browser setting that limits external redirects.



Could this in any way be caused by Django?
If this is not a Django issue what is causing it? and what would be a good work-around?










share|improve this question
















I have a very simple view that is purposed to track a user's click and redirect them to an external page:



def redirect_view(request, uu_id):
my_model = MyModel.objects.get(uuid = uu_id)
my_model.clicked_link = True
my_model.save()
return redirect('https://www.some-other-site.com')


For about half of the users that interact with this view it works perfectly! Our logs show a 302 response and then nothing further from the user.



For the other half of our users they are strangely redirected to the base url of our site in http, then because we have SECURE_SSL_REDIRECT = True they are redirected to https, and finally because they are not authenticated they are redirected for authentication.



Our logs for this type of user look something like this:



Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/redirect-url" host=mysite.com request_id=123 fwd="..." dyno=web.1 connect=0ms service=25ms status=302 bytes=268 protocol=https 
Feb 21 10:04:51 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=456 fwd="..." dyno=web.1 connect=1ms service=3ms status=301 bytes=262 protocol=http
Feb 21 10:04:52 myapp heroku/router: at=info method=GET path="/" host=mysite.com request_id=789 fwd="..." dyno=web.1 connect=0ms service=2ms status=302 bytes=360 protocol=https


There is nothing in our code that would suggest a redirect to our base url so my only thought is that they have some sort of browser setting that limits external redirects.



Could this in any way be caused by Django?
If this is not a Django issue what is causing it? and what would be a good work-around?







django google-chrome firefox redirect browser






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 19:11







grrrrrr

















asked Mar 25 at 18:56









grrrrrrgrrrrrr

8405 silver badges21 bronze badges




8405 silver badges21 bronze badges












  • I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

    – Louis
    Mar 28 at 17:14











  • @Louis This is all interpretation. Do you have any idea of what else could cause this?

    – grrrrrr
    Mar 28 at 21:46











  • I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

    – Mario Orlandi
    Mar 29 at 7:40











  • @MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

    – grrrrrr
    Mar 29 at 13:10











  • Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

    – Mario Orlandi
    Mar 30 at 7:23

















  • I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

    – Louis
    Mar 28 at 17:14











  • @Louis This is all interpretation. Do you have any idea of what else could cause this?

    – grrrrrr
    Mar 28 at 21:46











  • I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

    – Mario Orlandi
    Mar 29 at 7:40











  • @MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

    – grrrrrr
    Mar 29 at 13:10











  • Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

    – Mario Orlandi
    Mar 30 at 7:23
















I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

– Louis
Mar 28 at 17:14





I don't know of a browser setting that would explain what you report. How do you know that the scenario you think is happening is the actual one? Have users filed reports that correspond to what you see in the log? If you or your colleagues interpreted what was happening solely from looking at the logs, you may have misinterpreted what is going on.

– Louis
Mar 28 at 17:14













@Louis This is all interpretation. Do you have any idea of what else could cause this?

– grrrrrr
Mar 28 at 21:46





@Louis This is all interpretation. Do you have any idea of what else could cause this?

– grrrrrr
Mar 28 at 21:46













I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

– Mario Orlandi
Mar 29 at 7:40





I would try to raise an exception inside redirect_view() to see what happens. If the consequences are exactly the behaviour you describe, then you can focus your attention to MyModel.objects.get() and my_model.save(). I'm sure Django doesn't take any action by it's own

– Mario Orlandi
Mar 29 at 7:40













@MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

– grrrrrr
Mar 29 at 13:10





@MarioOrlandi on our end we can see that the model gets updated so get() and save() both work successfully, is that what you are describing?

– grrrrrr
Mar 29 at 13:10













Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

– Mario Orlandi
Mar 30 at 7:23





Uhh I see ... in that case my guess is wrong. As a matter of investigation, I would nonetheless throw an exception from the view. The user is redirected to error page 500. What happens next ?

– Mario Orlandi
Mar 30 at 7:23












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344736%2fdjango-redirect-interrupted-by-browser%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55344736%2fdjango-redirect-interrupted-by-browser%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript