English
Open in Telegram

Post🚀 New issue to wemake-services/django-modern-rest by @Izcarmt95

30 September 2026
W
wps_forward_bot
🚀 New issue to wemake-services/django-modern-rest by @Izcarmt95 📝 Router.include() raises KeyError for a route with an empty pattern ('') (#1657) Router.include() raises KeyError when the included router has a route with an empty pattern (path('', ...)), which is the usual way to mount a list endpoint at the router's prefix. from dmr import Controller from dmr.plugins.pydantic import PydanticSerializer from dmr.routing import Router, path class UserListController(Controller[PydanticSerializer]): def get(self) -> str: return 'ok' users = Router('/users', [path('', UserListController.as_view(), name='users')]) api = Router('api') api.include(users, namespace='users') # KeyError: '/users' File ".../dmr/routing.py", line 173, in include router.metadata_for(original_path), File ".../dmr/routing.py", line 217, in metadata_for return self._path_metadata[pattern] KeyError: '/users' Router.__init__ stores the metadata of the empty route under '/users/' (normalized with original_prefix=''), but include() looks it up as '/users' (normalized with original_prefix=router.prefix). Routes with a non-empty pattern (path('/<id>', ...)) are fine. Workaround: use an empty router prefix and write the full segment in each route (Router('', [path('/users', ...)])). • django-modern-rest 0.15.0 (it worked in 0.13.0, before include() looked up the metadata) • Django 5.2, Python 3.13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ AI disclaimer: an AI assistant was used only to help write this issue. #bug #good_first_issue #help_wanted #opensource_september #django_modern_rest sent via relator
1 · 346 ·

Nearby in the feed

Wwps_forward_bot🚀 New issue to wemake-services/wemake-python-styleguide by @sobolevn 📝 `WPS235`: ignore imports from `typing` (#3824) I can't limit the number of types I importWwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @Izcarmt95 📝 OpenAPI: duplicated tags when both Router(tags=...) and @modify(tags=...) set the same tag (#1
this message
Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Improve `dmr` skill with `concrete_views` example (#1670) We should state that using concrete_vWwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Improve `dmr` skill with CSRF example (#1671) Currently this example shows how to protect a vie
ННаходки в опенсорсе: PythonНаходки в опенсорсе: Python@opensource_findings_python · channel · Tech
1 052subscribers346average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count