I have view that perform particular action after that return i just want to call url and that url will open in the same page
def googleredirect(url):
return (url)
like in PHP :
header('Location: http://www.example.com/');
I have view that perform particular action after that return i just want to call url and that url will open in the same page
def googleredirect(url):
return (url)
like in PHP :
header('Location: http://www.example.com/');
If you want to only redirect then use:
# in views.py file
from django.shortcuts import redirect
def some_page(request):
return redirect('http://www.example.com/')
But if you want to open an URL for screen scraping or some thing else, then use python's own library urllib3 or PyQuery for more better DOM element search
If you mean Django-app (@Raptor removed django tag), your view should return an instance of django's HttpResponse
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
def google_redirect(request):
...
return HttpResponseRedirect(reverse('app_name:url_name'))