0

I'm trying to send a URL to an external website as a callback and I'm wondering if there is a way to pass the URL name from urlpatterns and required arguments.

The solution would return the full path of the URL as a string instead of hardcoding it.

The URL in urls.py looks something like this:

app_name = example_app
urlpatterns  = [
                ...
                '<int:example_id>/, views.my_function, name='some_name'
               ]

And I would like the URL to be something like this, where 1 is an example_id:

 https://my_site_domain.com/example/1/
Yves Gurcan
  • 1,096
  • 1
  • 10
  • 25
noble
  • 56
  • 9
  • You can get 'example/1/' from the named URL and for this 'https://my_site_domain.com/' you can use the hardcoded settings variable DOMAIN – danish_wani Dec 09 '20 at 13:33
  • https://stackoverflow.com/questions/17866114/django-get-absolute-url Maybe this will help you – ha-neul Dec 09 '20 at 13:46

0 Answers0