1👍
You can url encode the dict as below. You can get them in view through view parameters by appropriately writing pattern in urls.py, or through request.GET.get('key1')
in your view (here ‘key1’ is name of variable to be passed). So basically you will have to reconstruct the dict.
import urllib
my_dict = { 'key1': 'abc', 'key2': 100 }
uri = urllib.urlencode(my_dict)
fullurl = your_server_url + "/?" + uri
here your_server_url
is assumed to be your url
0👍
What Rohan said will do exactly what you want.
However, since you say you are new to Django I’d suggest you use the included batteries instead. As far as I can tell there is exactly one corner case where you’d want to pass a dictionary in the URL (which is when you are bringing in a user for the first time and want to bring some information with them).
If the above is not your use case, look into sessions instead.
If the you are trying to import information about your users via a URL please remember to validate the stuff you are getting.
- [Answer]-SMTPException in Django with GAE setting
- [Answer]-How I validate my Django Form with a File Upload