@register.simple_tag
def replace_page_param(query, page_number, page_key=u'p'):
 return conditional_escape(replace_page_in_query(query, page_number, page_key))

@ register . simple_tag def replace_page_param ( query , page_number , page_key = u'p' ) : return conditional_escape ( replace_page_in_query ( query , page_number , page_key ) )
replaces page_key from query string with page_number .