I have such a URL configuration
urlpatterns = [
url(r'webhook/', include('foward_bot.telegram_API.urls', namespace='api_webhook'), name='webhook'),
]
In telegram_API.urls I have
urlpatterns = [
url(r'^(?P<token>[-_:a-zA-Z0-9]+)/$', TelegramView.as_view(), name='api_webhook'),
]
When I try to access this callback url this way
webhook = reverse('webhook', args={instance.token})
I get an error message:
`Reverse for 'webhook' with arguments '(u'297704876:AAHiEy-slaktdaSMJfZtcnoDC-4HQYYDNOs',)' and keyword arguments '{}' not found. 0 pattern(s) tried: []`
I tried different options like
webhook = reverse('webhook', kwargs={'token': instance.token}),
webhook = reverse('webhook:token', kwargs={'token': instance.token}),
But I always go wrong NoReverseMatch
source
share