#25266: Allow regex for contrib.redirects
-----------------------------------+--------------------------------------
     Reporter:  berkerpeksag       |                    Owner:  nobody
         Type:  New feature        |                   Status:  new
    Component:  contrib.redirects  |                  Version:  master
     Severity:  Normal             |               Resolution:
     Keywords:                     |             Triage Stage:  Unreviewed
    Has patch:  0                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+--------------------------------------

Comment (by aaugustin):

 I had the same initial reaction to this ticket as Tim.

 In addition, this would change the interpretation of URLs containing a
 `.`, a `+`, or any other character that has a special meaning in regex. I
 don't have a good idea to preserve backwards compatibility there.

 There's also the question of how we would implement this efficiently. Not
 all supported databases can anwser "give me the list of rows where field
 `old_path` is a regex matching this value.

 I think a custom middleware (if you have many patterns) — perhaps a
 modified version of `RedirectFallbackMiddleware` — or a `RedirectView` (if
 you have a handful of patterns) is the way to go.

--
Ticket URL: <https://code.djangoproject.com/ticket/25266#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.0888ed29b807af32e4e0e43d9c4c4d35%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to