import os os.environ.setdefault( "DJANGO_SETTINGS_MODULE", "playlistdc.settings") from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise public_path = os.path.join( os.path.dirname(os.path.dirname(__file__)), 'public') application = get_wsgi_application() application = DjangoWhiteNoise(application) application.add_files(public_path, prefix='/')
""" WSGI config for fundcountdown 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fundcountdown.settings") application = DjangoWhiteNoise(get_wsgi_application()) application.add_files(os.path.join('ihavebeendays', 'public'))
LOCAL_HOSTNAME = socket.gethostname() os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djcon_chart.settings") os.environ.setdefault("BOKEH_LOAD_SERVER", "/bokeh") if port_free(): SERVER = Popen(['bokeh', 'serve', '--log-level=warning', '--host={0}/bokeh'.format(LOCAL_HOSTNAME), '--host={0}'.format(LOCAL_HOSTNAME), '--host=localhost:5006', '--host=127.0.0.1:5006', '--host=*:5006', '--host=*:8000', '--host=*/bokeh', '--host=*', '--host=localhost:8000', '--host=127.0.0.1:8000']) application = get_wsgi_application() # pylint: disable=C0103 try: from whitenoise.django import DjangoWhiteNoise application = DjangoWhiteNoise(application) # pylint: disable=C0103,R0204 application.add_files(bokeh.server.__path__[0] + os.sep + 'static', prefix='bokeh/', ) application.add_files(leaflet.__path__[0] + os.sep + 'static') except ImportError: pass except KeyError: pass
local_hostname = socket.gethostname() os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djcon_chart.settings") os.environ.setdefault("BOKEH_LOAD_SERVER", "/bokeh") if port_free(): server = Popen(['bokeh', 'serve', '--log-level=warning', '--host={0}/bokeh'.format(local_hostname), '--host={0}'.format(local_hostname), '--host=localhost:5006', '--host=127.0.0.1:5006', '--host=*:5006', '--host=*:8000', '--host=*/bokeh', '--host=*', '--host=localhost:8000', '--host=127.0.0.1:8000'] ) application = get_wsgi_application() # pylint: disable=C0103 try: from whitenoise.django import DjangoWhiteNoise application = DjangoWhiteNoise(application) application.add_files(os.environ['BOKEH_STATIC'], prefix='bokeh/') except ImportError: pass except KeyError: pass
from whitenoise.django import DjangoWhiteNoise try: import newrelic.agent except ImportError: newrelic = False if newrelic: newrelic.agent.initialize() # 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() # Wrap the Django WSGI app with WhiteNoise so the UI can be served by gunicorn # in production, avoiding the need for Apache/nginx on Heroku. application = DjangoWhiteNoise(application) application.add_files(settings.UI_ROOT) if newrelic: application = newrelic.agent.wsgi_application()(application) # Fix django closing connection to MemCachier after every request (#11331) from django.core.cache.backends.memcached import BaseMemcachedCache BaseMemcachedCache.close = lambda self, **kwargs: None # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application)
""" WSGI config for killedbycops 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 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "killedbycops.settings") BASE_DIR = os.path.dirname(os.path.dirname(__file__)) MEDIA_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'mediafiles')) # DRY, get this from django settings? from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(application) application.add_files(MEDIA_ROOT, prefix='media/')
""" WSGI config for pain_manager 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.8/howto/deployment/wsgi/ """ import os from whitenoise.django import DjangoWhiteNoise from django.core.wsgi import get_wsgi_application from django.conf import settings os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pain_manager.settings") application = get_wsgi_application() application = DjangoWhiteNoise(application) application.add_files(settings.BASE_DIR)
""" WSGI config for privateduty project. This module contains the WSGI application used by Django's development server 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 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "privateduty.settings") # 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.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise application = DjangoWhiteNoise(get_wsgi_application()) # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application)
framework. """ import os from django.conf import settings from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise # 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() # Use Whitenoise to serve static files # See: https://whitenoise.readthedocs.org/ application = DjangoWhiteNoise(application) application.add_files(settings.ROOT_DIR('staticfiles'), prefix='/') # Apply WSGI middleware here. # from helloworld.wsgi import HelloWorldApplication # application = HelloWorldApplication(application)
def init_application(cls): django_app = get_wsgi_application() return DjangoWhiteNoise(django_app)
""" WSGI config for djangp_og 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.10/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangp_og.settings") application = DjangoWhiteNoise("djangp_og") application = get_wsgi_application()
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 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'webalyzer.settings') from django.conf import settings from django.core.wsgi import get_wsgi_application from decouple import config from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(application) # Add media files if settings.MEDIA_ROOT and settings.MEDIA_URL: application.add_files(settings.MEDIA_ROOT, prefix=settings.MEDIA_URL) # Add NewRelic newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini') newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None) if newrelic_ini and newrelic_license_key: import newrelic newrelic.agent.initialize(newrelic_ini) application = newrelic.agent.wsgi_application()(application)
""" WSGI config for backend 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.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise # os.environ.setdefault("DJANGO_SETTINGS_MODULE", "backend.settings.devl") #used to be backend.settings application = get_wsgi_application() application = DjangoWhiteNoise( application) # need this for heroku local and maybe heroku in general
""" WSGI config for osmaxx 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.9/howto/deployment/wsgi/ """ import os from raven.contrib.django.middleware.wsgi import Sentry from whitenoise.django import DjangoWhiteNoise os.environ.setdefault("DJANGO_SETTINGS_MODULE", "web_frontend.config.settings.production") from django.core.wsgi import get_wsgi_application application = get_wsgi_application() application = Sentry(DjangoWhiteNoise(application))
from django.utils.importlib import import_module os.environ.setdefault("DJANGO_SETTINGS_MODULE", "graphite.settings") # noqa from django.conf import settings from django.core.wsgi import get_wsgi_application from graphite.logger import log application = get_wsgi_application() try: from whitenoise.django import DjangoWhiteNoise except ImportError: pass else: application = DjangoWhiteNoise(application) prefix = "/".join((settings.URL_PREFIX.strip("/"), "static")) for directory in settings.STATICFILES_DIRS: application.add_files(directory, prefix=prefix) for app_path in settings.INSTALLED_APPS: module = import_module(app_path) directory = os.path.join(os.path.dirname(module.__file__), "static") if os.path.isdir(directory): application.add_files(directory, prefix=prefix) # Initializing the search index can be very expensive. The import below # ensures the index is preloaded before any requests are handed to the # process. log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid()) import graphite.metrics.search # noqa
""" WSGI config for starseed 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/ https://devcenter.heroku.com/articles/django-assets """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "starseed.settings") from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(application)
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 os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sotw.settings') # NOQA from django.conf import settings from django.core.wsgi import get_wsgi_application import newrelic from decouple import config from whitenoise.django import DjangoWhiteNoise application = get_wsgi_application() application = DjangoWhiteNoise(application) # Add media files if settings.MEDIA_ROOT and settings.MEDIA_URL: application.add_files(settings.MEDIA_ROOT, prefix=settings.MEDIA_URL) # Add NewRelic newrelic_ini = config('NEW_RELIC_CONFIG_FILE', default='newrelic.ini') newrelic_license_key = config('NEW_RELIC_LICENSE_KEY', default=None) if newrelic_ini and newrelic_license_key: newrelic.agent.initialize(newrelic_ini) application = newrelic.agent.wsgi_application()(application)
from django.utils.importlib import import_module os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'graphite.settings') # noqa from django.conf import settings from django.core.wsgi import get_wsgi_application from graphite.logger import log application = get_wsgi_application() try: from whitenoise.django import DjangoWhiteNoise except ImportError: pass else: application = DjangoWhiteNoise(application) prefix = "/".join((settings.URL_PREFIX.strip('/'), 'static')) for directory in settings.STATICFILES_DIRS: application.add_files(directory, prefix=prefix) for app_path in settings.INSTALLED_APPS: module = import_module(app_path) directory = os.path.join(os.path.dirname(module.__file__), 'static') if os.path.isdir(directory): application.add_files(directory, prefix=prefix) # Initializing the search index can be very expensive. The import below # ensures the index is preloaded before any requests are handed to the # process. log.info("graphite.wsgi - pid %d - reloading search index" % os.getpid()) import graphite.metrics.search # noqa