views:

116

answers:

3

I am using def get_absolute_url in my model. It is giving the wrong "View on Site" link. How can it be corrected?

+1  A: 

Does the link start with example.com? If so, you might have to change the default Site domain in the Django admin site.

Arnaud
how it can be done
ha22109
@ha22109 Is the link starting with example.com? If so, log into the admin interface, and select the "Sites" option, and edit the site called "example.com". If the "Sites" option doesn't appear post back.
Dominic Rodger
A: 

commment out this line in sudo vi ~/python/../django/contrib/admin/tempplates/admin/change_form.html {% if has_absolute_url %}

  • {% trans "View on site" %}
  • {% endif%}

    ha22109
    A: 

    it is very simple just to to template directory and comment out the line where there is view on site.simple will work

    But mind it if u r not using it anyother place

    ha22109