Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

389
Vistas
Django + Apache(httpd): Error loading MySQLdb module

I have tried to figure this out for a day now and cannot seem to make any headway.

I'm getting the following Apache error:

[wsgi:error] django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
[wsgi:error] Did you install mysqlclient?
[wsgi:error] [remote 10.10.10.90:35990] mod_wsgi (pid=14165): Target WSGI script '/var/www/vhosts/project_vision/web/web/wsgi.py' does not contain WSGI application 'application'.

pip3 freeze states mysql-connector and mysql-connector-python is installed. The mysql-connector-python versions matches mysql-community rpm's installed.

File structure is this (web is the name of the Django project within the larger Project_vision project):

/var/www/vhosts/project_vision
 |- venv/
 |- web/
    |- static
    |- templates
    |- vision_web
       |- models/
       |- migrations/
       |- ...
    |- web
       |- settings.py
       |- wsgi.py
 |- ...

/var/www/vhosts/project_vision/web/web/wsgi.py

import os
import signal
import sys
import time
import traceback

from django.core.wsgi import get_wsgi_application

sys.path.append('/var/www/vhosts/project_vision')
sys.path.append('/var/www/vhosts/project_vision/web')
sys.path.append('/var/www/vhosts/project_vision/venv')

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

try:
    application = get_wsgi_application()
except Exception:
    # Error loading applications
    if 'mod_wsgi' in sys.modules:
        traceback.print_exc()
        os.kill(os.getpid(), signal.SIGINT)
        time.sleep(2.5)

/etc/httpd/conf.d/vision.conf

<VirtualHost *:80>

    ServerName my_project_vision.com

    DocumentRoot /var/www/vhosts/project_vision/web

    Alias /static/ /var/www/vhosts/project_vision/web/static/

    <Directory /var/www/vhosts/project_vision/web/static>
        Require all granted
    </Directory>

    WSGIDaemonProcess my_project_vision.com \
        processes=2 threads=15 display-name=%{GROUP} \
        python-home=/var/www/vhosts/project_vision/venv \
        python-path=/var/www/vhosts/project_vision/web

    WSGIProcessGroup my_project_vision.com
    WSGIApplicationGroup %{GLOBAL}

    # Insert the full path to the wsgi.py-file here
    WSGIScriptAlias / /var/www/vhosts/project_vision/web/web/wsgi.py

    <Directory /var/www/vhosts/project_vision>
        AllowOverride all
        Require all granted
        Options FollowSymlinks
    </Directory>

</VirtualHost>

Where in the world am I going wrong? It must be something minor but important...

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda