How to get query parameter from URL in Django

 

When a URL is like

 domain/pathname/?q=HelloWorld 

and you want to get the value of q in Django view you can use the below-written code.


url parameters explaination

 

def profile_page(request):
    message = request.GET.get('message')