I have django project. I want to use django admin site and have an url in django admin site to redirect user to certian url, so I used this code:
admin.py:
from django.contrib import admin
admin.site.site_url = 'http://localhost:8000/some-api-url/'
This code change VIEW SITE link in django admin. Problem is this url is static and I want to get server url dynamically, is there any approach to do that?
UPDATE:
I use postgres and neo4j, must of my models are in neo4j but some of them are in postgres. Django does not support neo4j models in admin site so we developed our frontend to support it. But django admin is complete so we want use it for our postgres models but for linking django admin to our site we need a link in django admin to our frontend. I think VIEW SITE link on top right of django admin site is a good link to use, I can change it, but I need a way to change it dynamically base on domain, so the question is how can I change 'VIEW SITE' url dynamically?