Manoj M J
Manoj M J

Reputation: 449

Django: i want to get a render a page according to specific userid obtained from another page

I have a page called userid.html in which a user is entering the userid. If this user id exists, he is taken to next page, sec.html where he is asked a security question which he has already set.

this security question is a context variable, and i need to render this page according to user id given in the previous page(userid.html), as security question of each user will be different.

How can this be done in django?

Thanks in advance

Upvotes: 0

Views: 61

Answers (2)

Aya
Aya

Reputation: 41950

The simplest option would be to pass in the user ID as a query parameter to the next page, i.e. if the user starts at page http://myserver/userid.html, and enters a user ID of 1234, then they're redirected to the page http://myserver/sec.html?userid=1234.

The second page can access the query parameter via the HttpRequest.GET dictionary.

Upvotes: 2

sawan gupta
sawan gupta

Reputation: 188

You can do this by session tracking. Django book explains it well.

Upvotes: 0

Related Questions