Beispiel #1
0
 def load(self):
     params = self.params.copy()
     params.update({'APPLICATION_URLS': self.urls})
     settings = cms.get_settings(__file__, self.settings_file, **params)
     from djpsite.apps.geo import Geo
     from djpsite.apps.ws import WebSocketApps
     Geo.username = settings.GEOUSERNAME
     # Create the permission handler
     permissions = PermissionHandler(settings)
     permissions.auth_backends.append(SocialAuthBackend())
     backend = permissions.auth_backends[0]
     # AUTHENTICATION MIDDLEWARE
     self.add_wsgi_middleware(permissions.header_authentication_middleware)
     self.add_wsgi_middleware(permissions.request_middleware())
     self.add_response_middleware(permissions.response_middleware())
     # WEB SOCKET MIDDLEWARE
     self.add_wsgi_middleware(ws.WebSocket(WebSocketApps('/ws/', settings)))
     # The root site
     site = cms.Site(settings, permissions=permissions)
     site.submit_data_middleware.add(cms.Referrer)
     # Add CSRF submit middleware
     site.submit_data_middleware.add(CSRF)
     # admin site
     settings = cms.get_settings(
         __file__,
         self.settings_file,
         APPLICATION_URLS  = admin.make_admin_urls())
     site.addsite(settings, route='/admin/')
     self.page_layouts(site)
     return site
Beispiel #2
0
 def load(self):
     params = self.params.copy()
     params.update({'APPLICATION_URLS': self.urls})
     settings = cms.get_settings(__file__, self.settings_file, **params)
     from djpsite.apps.geo import Geo
     from djpsite.apps.ws import WebSocketApps
     Geo.username = settings.GEOUSERNAME
     # Create the permission handler
     permissions = PermissionHandler(settings)
     permissions.auth_backends.append(SocialAuthBackend())
     backend = permissions.auth_backends[0]
     # AUTHENTICATION MIDDLEWARE
     self.add_wsgi_middleware(permissions.header_authentication_middleware)
     self.add_wsgi_middleware(permissions.request_middleware())
     self.add_response_middleware(permissions.response_middleware())
     # WEB SOCKET MIDDLEWARE
     self.add_wsgi_middleware(ws.WebSocket(WebSocketApps('/ws/', settings)))
     # The root site
     site = cms.Site(settings, permissions=permissions)
     site.submit_data_middleware.add(cms.Referrer)
     # Add CSRF submit middleware
     site.submit_data_middleware.add(CSRF)
     # admin site
     settings = cms.get_settings(__file__,
                                 self.settings_file,
                                 APPLICATION_URLS=admin.make_admin_urls())
     site.addsite(settings, route='/admin/')
     self.page_layouts(site)
     return site
Beispiel #3
0
 def load_site(self, website):
     from djpcms.apps.admin import make_admin_urls
     site = super(TestCaseWidthAdmin,self).load_site(website)
     settings_admin = get_settings(self.settings,
                                   APPLICATION_URLS=make_admin_urls(),
                                   INSTALLED_APPS=self.installed_apps)
     site.addsite(settings_admin, route='/admin/')
     return site