I am trying to redirect the user to a URl but it is redirecting me to an incorrect url.
views.py:
def redirect_shortner(request):
return redirect('www.google.com')
url.py:
urlpatterns = [
path('', redirect_shortner, name='redirect_shortner'),
]
The code appears correct to me but the user is incorrectly redirected to a url with the current url appended with the specfied url, i.e. the user is redirected to http://127.0.0.1:8000/www.google.com
when http://127.0.0.1:8000/
is the current url.