Hello,

I have a model `Transaction` which can be viewed at the url: 
/transaction/view/$ID/ - if I just enter that url in the browser, or in 
template everything works. But when I have the following get_abolute_url() 
method:

def get_absolute_url(self):
     return "/transaction/view/{}/".format( self.id )

things do not work from the Admin. When I click on the "View on Site" link 
i am redirected to "http://example.com/transaction/view/23635/"; and I get 
an error message about failed XML parsing. I have no clue where the 
"example.com" address comes from - that string is not in my codebase. If I 
hardcode the get_absolute_url to:

def get_absolute_url(self):
     return "http://127.0.0.1:8000/transaction/view{}/".format(self.id)

That works in development, but needless to say that is not a very good 
approach.

I am on Django 1.10


Regard Joakim


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c6e8b55d-56b5-40f4-8505-76f1447c1542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to