[Baypiggies] Django url regex weirdness

Mitch Patenaude patenaude at gmail.com
Sun Sep 20 18:41:26 CEST 2015


Hi BayPiggies,

I'm trying to write a simple little django app, and I'm trying get it to
match a URL of the form
list/<min_x>,<min_y>/to/<max_x>,<max_y>/
Where the coords are floats.  for example:
list/37,-122.5/to/37.5,-122/

Here's the regex from my module's urls.py:
 url(r'^list/{?P<min_coords>(-?[0-9]+\.?[0-9]*,-?[0-9]+\.?[0-9]*)}/to/{?P<max_coords>(-?[0-9]+\.?[0-9]*\,-?[0-9]+\.?[0-9]*)}/',
views.tplist, name='list'),

I've tried it without the parens as well.  I've verified that the basic
regex works using the re module, but django is just returning a 404.  Does
anybody see my problem?

Thanks,
  -- Mitch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20150920/b3c278e6/attachment.html>


More information about the Baypiggies mailing list