Skip to content

Instantly share code, notes, and snippets.

@feliphebueno
Created June 26, 2017 15:10
Show Gist options
  • Save feliphebueno/ad60b65c4a371876bff824d3accbec04 to your computer and use it in GitHub Desktop.
Save feliphebueno/ad60b65c4a371876bff824d3accbec04 to your computer and use it in GitHub Desktop.
Exemplo de wsgi.py de uma Django App para rodar com o Apache mod_wsgi multi applications
"""
WSGI config for YourDjangoApp 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
import sys
# API Root
sys.path.insert(0, "/path/to/YourDjangoApp/")
# Path da pasta site-packages/ que contém as dependências deste projeto(mod_wsgi only)
sys.path.insert(1, "/path/to/your-virtual-env/lib/python3.5/site-packages/")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "YourDjangoApp.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment