How to redirect to external URL in Django?

Yeah, return redirect('http://stackoverflow.com/') is the correct method.

If you do the following, you can confirm that is a working method to redirect.

   from django.shortcuts import redirect

   def optout(request):
       return redirect("http://stackoverflow.com/")

Your conditional statements must not be catching.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)