Esempio n. 1
0
import os

from django.core.wsgi import get_wsgi_application
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry

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

application = Sentry(get_wsgi_application())
Esempio n. 2
0
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

from django.core.wsgi import get_wsgi_application
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
    from raven.contrib.django.raven_compat.middleware.wsgi import Sentry

# 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"] = "config.settings.production"
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.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.
application = get_wsgi_application()
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
    application = Sentry(application)
# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
Esempio n. 3
0
# 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 django.conf import settings

# sentry WSGI handler if configured
# more info here: http://raven.readthedocs.org/en/latest/config/django.html#wsgi-middleware
if getattr(settings, 'RAVEN_CONFIG', {}):
    from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
    from django.core.handlers.wsgi import WSGIHandler
    application = Sentry(WSGIHandler())
# django default wsgi
else:
    from django.core.wsgi import get_wsgi_application
    application = get_wsgi_application()
Esempio n. 4
0
"""
WSGI config for ui app.

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.8/howto/deployment/wsgi/
"""
import os

from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
from django.core.wsgi import get_wsgi_application

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

application = Sentry(get_wsgi_application())  # pylint: disable=invalid-name
Esempio n. 5
0
"""
WSGI config for wheelso 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 raven.contrib.django.raven_compat.middleware.wsgi import Sentry
from whitenoise import WhiteNoise

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wheelso.settings")
os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')

from configurations.wsgi import get_wsgi_application  # noqa

application = get_wsgi_application()
application = Sentry(WhiteNoise(application, root='../static'))
# application.add_files('/path/to/more/static/files', prefix='more-files/')
Esempio n. 6
0
"""
WSGI config for project 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
{% if cookiecutter.with_sentry %}from raven.contrib.django.raven_compat.middleware.wsgi import Sentry{%endif %}

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.prod")

{% if cookiecutter.with_sentry
%}application = Sentry(get_wsgi_application()){% else
%}application = get_wsgi_application(){% endif %}
Esempio n. 7
0
#!usr/bin/env python
# -*- coding:utf-8 -*-

"""
@author: huoyijie
@file: wsgi.py
@time: 2018/08/29

@copyright: (c) 2018 by huoyijie, https://github.com/huoyijie/weku
@license: GPL v3, see LICENSE for more details.
"""
import os
from django.core.wsgi import get_wsgi_application
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry

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

application = get_wsgi_application()

sentry = Sentry(application)