passing a get parameter in django named variable -


my url patterns defined in django -

url(r'^import-contacts$', 'import_contacts', name='import_contacts'), 

the view expects parameter, parse in view , process it, url should of format - http://127.0.0.1:8000/import-contact/?service=google

in template following -

<a href="{% url "import_contacts" %}"> text here </a> 

this generate following url - http://127.0.0.1:8000/import-contact/ , not url reqd.

any idea on how pass variables named url params.

just add after tag:

<a href="{% url "import_contacts" %}?service=google">  

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -