Linked Questions

Popular Questions

When a user finish to login, i'd like to redirect to another app(app_2). At the end of the url i'd like that the URL be .../app_2/username. And not .../app_2

Her's my code:


from django.shortcuts import render
# Create your views here.
def index(request,user_name)):
    return render(request,'app_2/index.html',{'user_key':user_name}) 


from django.urls import path
from . import views

urlpatterns =[
    path('<user_name>', views.index),

In another app, i made a test.


if Authentification(request,username,password):
    request.session['username_key'] = username
    return redirect('/app_2/',{'key_app_1':username})

Related Questions