[Django] #29218: Custom URL converters break direct urls.py modules import

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #29218: Custom URL converters break direct urls.py modules import

Django
#29218: Custom URL converters break direct urls.py modules import
-----------------------------------------+------------------------
               Reporter:  Sergey Fursov  |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  Core (URLs)    |        Version:  2.0
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  0
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Hi.

 I found this problem after conversion all urls in one of my projects to
 modern named params.
 I created custom URL Converter class and registered it in root url conf
 I test my project code using py.test with enabled `doctest-modules`
 option. With this option py.test imports all modules and search docstring
 tests in each. Same happens with individual urls.py modules, but direct
 module import fails with next stacktrace:
 {{{
 api/urls.py:86: in <module>
     name='module',
 /usr/local/lib/python3.6/site-packages/django/urls/conf.py:70: in _path
     pattern = Pattern(route, name=name, is_endpoint=True)
 /usr/local/lib/python3.6/site-packages/django/urls/resolvers.py:242: in
 __init__
     self.converters = _route_to_regex(str(route), is_endpoint)[1]
 /usr/local/lib/python3.6/site-packages/django/urls/resolvers.py:225: in
 _route_to_regex
     "URL route '%s' uses invalid converter %s." % (original_route, e)
 E   django.core.exceptions.ImproperlyConfigured: URL route
 'modules/<slug:slug>/<uid:uid>/' uses invalid converter 'uid'.
 }}}


 I'm not sure if this issue should be solved inside Django itself, but I
 thought it would be helpful to report it.

--
Ticket URL: <https://code.djangoproject.com/ticket/29218>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.5b66a2593d86b60812aba1c9148f0460%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29218: Custom URL converters break direct urls.py modules import

Django
#29218: Custom URL converters break direct urls.py modules import
-------------------------------+--------------------------------------
     Reporter:  Sergey Fursov  |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Core (URLs)    |                  Version:  2.0
     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 Tim Graham):

 The report doesn't help me understand the issue in much detail. Can you
 debug it a bit further so we can understand what's going on (to help
 decide how to proceed), or at least provide a minimal sample project so
 that someone else can?

--
Ticket URL: <https://code.djangoproject.com/ticket/29218#comment:1>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.73714129e3dde69804ca8d883155fdc1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29218: Custom URL converters break direct urls.py modules import

Django
In reply to this post by Django
#29218: Custom URL converters break direct urls.py modules import
-------------------------------+--------------------------------------
     Reporter:  Sergey Fursov  |                    Owner:  nobody
         Type:  Bug            |                   Status:  closed
    Component:  Core (URLs)    |                  Version:  2.0
     Severity:  Normal         |               Resolution:  invalid
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by Simon Charette):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 From your provided stackstrace it looks like the message points at the
 correct error `URL route 'modules/<slug:slug>/<uid:uid>/' uses invalid
 converter 'uid'.`

 Django doesn't ship with a `uid` path converter, it should be `uuid`.

 Please rely on [wiki:TicketClosingReasons/UseSupportChannels our support
 channels] to assert Django is actually at fault before filling such a
 ticket next time. Thanks!

--
Ticket URL: <https://code.djangoproject.com/ticket/29218#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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.69b8418415a78177fc9b7004b8c06db7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.