コード例 #1
0
ファイル: utils.py プロジェクト: pombredanne/djpcms
 def __init__(self,
              site,
              nginx_server,
              target=None,
              proxy_server='http://localhost:8060',
              logdir=None,
              redirects=None,
              path=None):
     self.site = site
     self.settings = site.settings
     if not target:
         target = '{0}_nginx.conf'.format(self.settings.SITE_MODULE)
         if path:
             target = os.path.join(path, target)
     self.data = None
     self.params = params = {}
     params['nginx_server'] = server_info(nginx_server)
     proxy = server_info(proxy_server)
     params['secure'] = secure = proxy.pop('secure')
     if secure != params['nginx_server'].pop('secure'):
         raise valueError('nginx and proxy server have conflicting http')
     params['proxy_server'] = proxy_server
     params['logdir'] = logdir
     apps = application_map(self.settings.INSTALLED_APPS, safe=False)
     params['applications'] = apps.values()
     self.target = target or 'nginx.conf'
     params['redirects'] = redirects or []
     params['site'] = apps[self.settings.SITE_MODULE]
コード例 #2
0
ファイル: utils.py プロジェクト: pombredanne/djpcms
 def __init__(self, site, nginx_server,
              target = None,
              proxy_server = 'http://localhost:8060',
              logdir = None, redirects = None,
              path = None):
     self.site = site
     self.settings = site.settings
     if not target:
         target = '{0}_nginx.conf'.format(self.settings.SITE_MODULE)
         if path:
             target = os.path.join(path,target)
     self.data = None
     self.params = params = {}
     params['nginx_server'] = server_info(nginx_server)
     proxy = server_info(proxy_server)
     params['secure'] = secure = proxy.pop('secure')
     if secure != params['nginx_server'].pop('secure'):
         raise valueError('nginx and proxy server have conflicting http')
     params['proxy_server'] = proxy_server
     params['logdir'] = logdir
     apps = application_map(self.settings.INSTALLED_APPS, safe=False)
     params['applications'] = apps.values()
     self.target = target or 'nginx.conf'
     params['redirects'] = redirects or []
     params['site'] = apps[self.settings.SITE_MODULE] 
コード例 #3
0
ファイル: utils.py プロジェクト: pombredanne/djpcms
 def config_files(self, site, context, dir=None, release=True):
     ctx = self.get_context(context)
     dns = [ctx['dns']] + ctx['redirects']
     ndns = [r.replace('.', '\.') for r in dns]
     ser.all_redirects = '|'.join(ndns)
     ser.apps = application_map(site.settings.INSTALLED_APPS,
                                safe=False).values()
     environ['nginx'] = config_file(self, self.nginx, ctx, dir=dir)
     if not release:
         from __builtin__ import globals
         g = globals()
         g['script_result'] = environ
コード例 #4
0
ファイル: utils.py プロジェクト: pombredanne/djpcms
 def config_files(self, site, context, dir = None, release = True):
     ctx = self.get_context(context)
     dns = [ctx['dns']] + ctx['redirects']
     ndns = [r.replace('.','\.') for r in dns]
     ser.all_redirects = '|'.join(ndns)
     ser.apps = application_map(site.settings.INSTALLED_APPS,
                                 safe=False).values()
     environ['nginx'] = config_file(self, self.nginx, ctx, dir=dir)
     if not release:
         from __builtin__ import globals
         g = globals()
         g['script_result'] = environ