[Baypiggies] Django url regex weirdness

Mitch Patenaude patenaude at gmail.com
Mon Sep 21 02:09:09 CEST 2015


The problem was that I misread the example, and the outer set of braces
({}) should have been parens instead.

Sorry for the stupid question
  -- Mitch

On Sun, Sep 20, 2015 at 9:41 AM, Mitch Patenaude <patenaude at gmail.com>
wrote:

> 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/5ea916b5/attachment.html>


More information about the Baypiggies mailing list