Received Argument from website URL and redirect to another Page

Hello
I’m using frappe v5.0.0-beta
I need received argument from web site URL like “www.example.com/book?name=something”.
and I want to redirect from “def get_context(context):” function.

So please help me how can I received “name” Argument and redirect to another page like “www.example.com/anotherpage”?

Thanks

1 Like

Set frappe.local.flags.redirect_location

and raise frappe.Redirect

see: frappe/web_page.py at 89e95cd6b16ce2af4abd23b077eab2c7278a1a6a · frappe/frappe · GitHub

2 Likes

Thanks you Rmehta
for your help
Now I can redirect
But still now I can’t Received argument from web URL like “www.example.com/book?name=something”.

I want received “name” argument

You can also try this:

https://github.com/frappe/frappe/blob/develop/frappe/templates/pages/login.py#L172

hi @mainul ,

Have you found how to get argument value from url?

@ninjas005 Yes, you can receive argument by frappe.form_dict there have all arguments as a Dictionary.

1 Like

thanks @mainul :slight_smile: