简体   繁体   中英

Django passing string arguments

Please how can I pass a string arguments to django path
path('mysite/?$', search, name='search')
instead of the ?$ I want to pass the argument that the get method has ! how can I do that ??

I guess you need something like that:

path('mysite/<int:number>', views.search, name='search'),

or

path('mysite/<str:search>', views.search, name='search'),

in you urls.py

Also don't forget to add an argument to the search in the views.py

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM