Example #1
0
"""
WSGI config for hpc 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
from django.conf import settings
# from whitenoise import WhiteNoise

if settings.DEBUG:
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings.base")
else:
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings.base")

application = get_wsgi_application()
application = DjangoWhiteNoise(application)
application.add_files(os.path.join(settings.MEDIA_ROOT))
Example #2
0
"""
WSGI config for smallslive 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.6/howto/deployment/wsgi/
"""

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

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

application = DjangoWhiteNoise(get_wsgi_application())
application.add_files('media', prefix='media/')
Example #3
0
    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
Example #4
0
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='/')
Example #5
0
"""
WSGI config for layup_list 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
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "layup_list.settings")

from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise
from settings import ROOT_ASSETS_DIR

application = get_wsgi_application()
application = DjangoWhiteNoise(application)
application.add_files(ROOT_ASSETS_DIR)
Example #6
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/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)
Example #7
0
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)
Example #8
0
"""
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/')
Example #9
0
from django.core.wsgi import get_wsgi_application
from whitenoise.django import DjangoWhiteNoise

application = get_wsgi_application()
application = DjangoWhiteNoise(application)
application.add_files('/app/commonstatic', prefix='djstatic/')
Example #10
0
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)
Example #11
0
"""
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'))
Example #12
0

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

Example #13
0
"""
WSGI config for cinema 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
from whitenoise.django import DjangoWhiteNoise

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

application = DjangoWhiteNoise(get_wsgi_application())
application.add_files('/home/betdav71/Рабочий стол/proj/cinema/media', prefix='media/')
Example #14
0
"""
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)
Example #15
0
application = get_wsgi_application()

try:
    import whitenoise
except ImportError:
    whitenoise = False
else:
    # WhiteNoise < 2.0.1 does not support Python 2.6
    if sys.version_info[:2] < (2, 7):
        whitenoise_version = tuple(map(
                int, getattr(whitenoise, '__version__', '0').split('.')))
        if whitenoise_version < (2, 0, 1):
            whitenoise = False

if whitenoise:
    from whitenoise.django import DjangoWhiteNoise
    application = DjangoWhiteNoise(application)
    prefix = "/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
Example #16
0
"""
WSGI config for serverpl 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, sys

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

path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

if not path in sys.path:
    sys.path.append(path)

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
statcdir=os.path.join(os.path.dirname(os.path.abspath(__file__)),'static/')

print("currentstatic",statcdir)

application = get_wsgi_application()
application = DjangoWhiteNoise(application)
application.add_files(root=statcdir)

Example #17
0
"""
WSGI config for oneanddone 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', 'oneanddone.settings')

from django.conf import settings  # NOQA
from django.core.cache.backends.memcached import BaseMemcachedCache  # NOQA
from django.core.wsgi import get_wsgi_application  # NOQA

from whitenoise.django import DjangoWhiteNoise  # NOQA

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)

# Fix django closing connection to memcached after every request (#11331)
# From https://devcenter.heroku.com/articles/memcachier#django
BaseMemcachedCache.close = lambda self, **kwargs: None
Example #18
0
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
Example #19
0
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pyconguide.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='/')
Example #20
0
"""
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/')