implement Jinja filter to calculate the parent domain of a domain
This commit is contained in:
parent
68c7e036b2
commit
6b8c1710ca
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,13 @@ INSTALL_CMD = '/usr/bin/install'
|
||||||
JINJAENV = Environment(loader=PackageLoader('webtasks', 'templates'))
|
JINJAENV = Environment(loader=PackageLoader('webtasks', 'templates'))
|
||||||
|
|
||||||
|
|
||||||
|
def _jinja_parentdomain(domain):
|
||||||
|
return '.'.join(domain.split('.')[1:])
|
||||||
|
|
||||||
|
|
||||||
|
JINJAENV.filters['parentdomain'] = _jinja_parentdomain
|
||||||
|
|
||||||
|
|
||||||
def _build_vhost_config_path(sitename):
|
def _build_vhost_config_path(sitename):
|
||||||
return os.path.join(settings.GVAWEB_NGINX_SITES_AVAILABLE, sitename)
|
return os.path.join(settings.GVAWEB_NGINX_SITES_AVAILABLE, sitename)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue