Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# encoding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import channels.asgi
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
channel_layer = channels.asgi.get_channel_layer()
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "main.settings")
channel_layer = get_channel_layer()
"""
ASGI entrypoint file for default channel layer.
Points to the channel layer configured as "default" so you can point
ASGI applications at "liveblog.asgi:channel_layer" as their channel layer.
"""
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "liveblog.settings.redis")
channel_layer = get_channel_layer()
"""
WSGI config for logtacts project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
from asgiref.wsgi import WsgiToAsgiAdapter
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "logtacts.prod_settings")
channel_layer = get_channel_layer()
application = WsgiToAsgiAdapter(channel_layer)
#data = channel_layer.group_channels('notifications')
#data = channel_layer.global_statistics()
#data = channel_layer.channel_statistics('notifications')
#data = get_channel_layer().group_channels('notifications')
#data = Group("notifications").extensions
#data = get_channel_layer().receive_twisted()
#from channels import channel_layers
#layer = channel_layers["default"]
#print(layer.router.channels)
data = []
from django.contrib.sessions.backends import cache as engine
data = get_channel_layer().group_channels('notifications')
active_users = []
for C in data:
#Channel(C).send({"text": json.dumps({'clean_signal':True})})
c_session = session_for_reply_channel(C)
session = engine.SessionStore(c_session._session_key)
#print(c_session._session['_auth_user_id'])
#print(session.keys())
#print(session.get('username', None), session.get_expiry_date())
username = session.get('username', None)
# this is the same
# username = c_session.get('username', None)
if username not in active_users and username != None:
active_users.append(username)
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphspace.settings.production")
channel_layer = get_channel_layer()
from graphspace.database import *
from django.conf import settings
settings.db = Database()
from applications.notifications.consumer import *
# Start owner notification consumer
ocon = Consumer("owner")
ocon.start()
# Start group notification consumer
gcon = Consumer("group")
gcon.start()
if MODE == 'production':
logger = logging.getLogger('awx.main.models.jobs')
try:
fd = open("/var/lib/awx/.tower_version", "r")
if fd.read().strip() != tower_version:
raise Exception()
except Exception:
logger.error("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
raise Exception("Missing or incorrect metadata for Tower version. Ensure Tower was installed using the setup playbook.")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "awx.settings")
channel_layer = get_channel_layer()
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings.dev_settings")
channel_layer = get_channel_layer()
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fexum.settings")
channel_layer = get_channel_layer()
import os
from channels.asgi import get_channel_layer
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "onadata.settings.common")
channel_layer = get_channel_layer()