get base url

help me buddy
how to get a running base url?
in admin.py, new function/method

example javascript
windows.location.origin


or
http://localhost

If you are new to Django, you should work your way through either the official Django tutorial or the Django Girls tutorial. You’ll find a lot of your questions will be answered by them.

thanks for the advice