Your comments

May I suggest to move line 45 "self.slug=..." just after line 32 "self.name=..." and then in line 42 replacing with j.get('root', '/var/www/'+self.slug+'/public_html') or anything else than /var/www but you get a slugged path, compliant with nginx.


Thanks for the original trick !