SyntaxFix
Write A Post
Hire A Developer
Questions
domain = self.env['ir.config_parameter'].get_param('web.base.url')
I got the hostname and port number using this.