How do i pass a primary key to a login redirect url.
Please be more specific here. Are you talking about passing the primary key to the login page, or are you talking about passing the primary key to the page that you get redirected to after a successful login? (I’m also assuming you’re not talking about the User object primary key or the primary key of any object directly related to the User object. If you are, then retrieving that pk is a matter of retrieving it from the request object passed to your view.)
You’ve got a couple of different methods you could use for this.
- Pass it as a query parameter through the URL.
- Store it in the user’s session.
Either way may mean that you’ll be writing your own login view to know what to do with this information.