问题
Why "view on site" linked to an unwanted page? Can I disable it?
回答1:
View on site determines the URL to link to by checking the Sites app and adding the model's get_absolute_url() method on the end of it.
回答2:
See the django-docs You can overwrite the admin-templates or see here, how to use it
回答3:
the easiest and cleanest way is to set admin.site.site_url = None in your root urls.py
it works since django 1.8, here is the documentation
回答4:
sudo vi /usr/local/lib/python2.6/dist-packages/django/contrib/admin/templates/admin$/change_from.html.
in this file comment out the if condition
{% if has_absolute_url %}
then view on site will never appear
来源:https://stackoverflow.com/questions/964868/view-on-site-button-is-linked-to-an-unwanted-page