예제 #1
0
"""
WSGI config for journey 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/gunicorn/
"""
import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "journey.config")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")

from configurations.wsgi import get_wsgi_application  # noqa
application = get_wsgi_application()
예제 #2
0
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/gunicorn/
"""
import json
import os

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hsv_dot_beer.config')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Production')

from configurations.wsgi import get_wsgi_application  # noqa


class CloudflareProxy(object):
    def __init__(self, app):
        self.app = app

    def __call__(self, environ, start_response):
        cf_visitor = environ.get('HTTP_CF_VISITOR')
        if cf_visitor:
            try:
                cf_visitor = json.loads(cf_visitor)
            except ValueError:
                pass
            else:
                proto = cf_visitor.get('scheme')
                if proto is not None:
                    environ['wsgi.url_scheme'] = proto
        return self.app(environ, start_response)


application = CloudflareProxy(get_wsgi_application())
예제 #3
0
"""
WSGI config for bookshub 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/dev/howto/deployment/wsgi/
"""

import os

ENVIRONMENT = os.getenv('ENVIRONMENT', 'DEVELOPMENT').title()

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bookshub.settings")
os.environ.setdefault('DJANGO_CONFIGURATION', ENVIRONMENT)

from configurations.wsgi import get_wsgi_application
from dj_static import Cling

application = Cling(get_wsgi_application())
예제 #4
0
It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""

import os
import sys

sys.path.insert(0, os.path.abspath('..'))

ENVIRONMENT = os.getenv('ENVIRONMENT', 'DEVELOPMENT').title()

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chatrooms.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', ENVIRONMENT)

from dj_static import Cling
from configurations.wsgi import get_wsgi_application
from django.conf import settings
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer

_django_app = Cling(get_wsgi_application())
_websocket_app = uWSGIWebsocketServer()


def application(environ, start_response):
    if environ.get('PATH_INFO').startswith(settings.WEBSOCKET_URL):
        return _websocket_app(environ, start_response)
    return _django_app(environ, start_response)
예제 #5
0
# MIT License
# Copyright (c) 2017 MassChallenge, Inc.

import os
import newrelic.agent
from django.conf import settings

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

# environ must be set before importing jazzband/django-configurations
from configurations.wsgi import get_wsgi_application  # noqa: E402

newrelic_application = newrelic.agent.wsgi_application()
application = newrelic_application(get_wsgi_application())
newrelic.agent.initialize(settings.NEW_RELIC_CONFIG_FILE,
                          settings.NEW_RELIC_ENVIRONMENT)
예제 #6
0
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.

Usually you will have the standard Django WSGI application here, but it also
might make sense to replace the whole Django WSGI application with a custom one
that later delegates to the Django one. For example, you could introduce WSGI
middleware here, or combine a Django application with an application of another
framework.

"""
import os

# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
# if running multiple sites in the same mod_wsgi process. To fix this, use
# mod_wsgi daemon mode with each site in its own daemon process, or use
# os.environ["DJANGO_SETTINGS_MODULE"] = ".settings"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config")
os.environ.setdefault("DJANGO_CONFIGURATION", "Production")

# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
from configurations.wsgi import get_wsgi_application
application = Sentry(get_wsgi_application())

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
예제 #7
0
import os
import sys
from configurations.wsgi import get_wsgi_application

#sys.path.append('/home/shaman/workspace/get-face')
#sys.path.append('/home/shaman/miniconda3/envs/get_face/lib')
#os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
#from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Development')

get_face = get_wsgi_application()
예제 #8
0
파일: wsgi.py 프로젝트: kylincode/marsha
"""WSGI script for the marsha project."""

from configurations.wsgi import get_wsgi_application


application = get_wsgi_application()  # pylint: disable=invalid-name
예제 #9
0
파일: wsgi.py 프로젝트: mythmon/jyfes
import os

from configurations.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jyfes.settings")
os.environ.setdefault("DJANGO_CONFIGURATION", "Base")

application = DjangoWhiteNoise(get_wsgi_application())