Reputation: 8336
Why "view on site" linked to an unwanted page? Can I disable it?
Upvotes: 1
Views: 3778
Reputation: 971
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
Upvotes: 1
Reputation: 8336
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
Upvotes: -4
Reputation: 2559
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.
Upvotes: 4
Reputation: 52237
See the django-docs You can overwrite the admin-templates or see here, how to use it
Upvotes: 3