Ejemplo n.º 1
0
"""
WSGI config for testproj 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/2.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testproj.settings')

application = get_wsgi_application()

from socketio_app.views import sio
import socketio
# from socketio import Middleware

# application = socketio.WSGIApp(sio, application)

from socketio import Middleware
application = Middleware(sio, application)

import eventlet
import eventlet.wsgi
eventlet.wsgi.server(eventlet.listen(('', 8000)), application)
Ejemplo n.º 2
0
"""
WSGI config for handsome 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.11/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application
from socketio import Middleware
from backend.socket import sio

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "handsome.settings")

backend = get_wsgi_application()
application = Middleware(sio, backend)
Ejemplo n.º 3
0
"""
WSGI config for SIH 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/2.0/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application
from socketio import Middleware

from socketio_app.views import sio

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "SIH.settings")

django_app = get_wsgi_application()
application = Middleware(sio, django_app)
Ejemplo n.º 4
0
from socketio import Middleware
from core.server import app, sio
from eventlet import wsgi, listen
import json

import resources
import sockets

if __name__ == '__main__':
    with open("config.json") as json_file:
        config = json.load(json_file)

    app = Middleware(sio, app)
    wsgi.server(listen(('', config["port"])), app)