I want my urls.py to capture a long url setting as such:
/get/<lowercase_string>/<integer>/<date>/<date>/
For instance: www.mysite.com/get/ams/221/12-23-2010/01-10-2011/
, as you may see date is in month/day/year format.
As my regex knowledge is near to nothing, I will be grateful for you guidance. I will be capturing <lowercase_string>
, <integer>
, <date>
, <date>
parts at my view.
Thanks.
^get/([a-z]+)/(\d+)/(\d{2}-\d{2}-\d{4})/(\d{2}-\d{2}-\d{4})/
#to capture the values in variables:
^get/(?P<lowercase_string>[a-z]+)/(?P<integer>\d+)/(?P<date1>\d{2}-\d{2}-\d{4})/(?P<date2>\d{2}-\d{2}-\d{4})/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With