I have a post request
http://localhost:8000/api/orders/shipment
what i want to do is i dont want to pass domain/ip address and access the api something like Django admin console give "172.18.0.1 - - [08/Sep/2017 14:30:29] "POST /adminorder/order/import/ HTTP/1.1" 200 "
I searched in the django documentation get_absolute_url() method is there to define custom urls, I am not getting how to use this in this scenario.
I believe it's impossible to use a relative url in requests, but you can get around this by creating a function which prepends the relevant domain to your url. (Make sure to import your settings file!)
Therefore
print(create_url("api/test/anothertest"))
will returnhttp://localhost:8000/api/test/anothertest
.And this is how you would use it: