Acabo de configurar una aplicación django en virtualenv, el despliegue se realizó sin problemas utilizando un script de estructura, pero ahora el .wsgi no funciona, he probado todas las variaciones en Internet, pero sin suerte. Mi archivo .wsgi es:django + mod_wsgi en virtualenv no funciona
import os
import sys
import django.core.handlers.wsgi
# put the Django project on sys.path
root_path = os.path.abspath(os.path.dirname(__file__) + '../')
sys.path.insert(0, os.path.join(root_path, 'kcdf'))
sys.path.insert(0, root_path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'kcdf.settings'
application = django.core.handlers.wsgi.WSGIHandler()
sigo obteniendo el mismo error:
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] mod_wsgi (pid=16938): Exception occurred processing WSGI script '/home/kcdfweb/webapps/kcdf.web/releases/current/kcdf/apache/kcdf.wsgi'.
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] Traceback (most recent call last):
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 230, in __call__
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] self.load_middleware()
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 33, in load_middleware
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] for middleware_path in settings.MIDDLEWARE_CLASSES:
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] File "/usr/local/lib/python2.6/dist-packages/django/utils/functional.py", line 269, in __getattr__
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] self._setup()
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 40, in _setup
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] self._wrapped = Settings(settings_module)
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] File "/usr/local/lib/python2.6/dist-packages/django/conf/__init__.py", line 75, in __init__
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] raise ImportError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)
[Sun Apr 18 12:44:30 2010] [error] [client 41.215.123.159] ImportError: Could not import settings 'kcdf.settings' (Is it on sys.path? Does it have syntax errors?): No module named kcdf.settings
mi entorno virtual está en/home/usuario/webapps/kcdfweb mi aplicación es/home/usuario/webapps /kcdf.web/releases/current/project_name mi archivo wsgi home/usuario/webapps/kcdf.web/releases/corriente/project_name/Apache/project_name.wsgi
trataron de que no funcionó, podría valer la pena señalar que cuando creé un proyecto Django muestra fuera del virtualenv y trató de correr la misma Tengo: jwesonga @ KCDF: ~/probador $ exportación DJANGO_SETTINGS_MODULE = tester.settings jwesonga @ kcdf: ~/tester $ django-admin.py runserver Error: No se pudieron importar las configuraciones 'tester.settings' (¿Está en sys.path? ¿Tiene errores de sintaxis?): Ningún módulo llamado tester.settings – jwesonga