Hello all I have been following the documentation to install mod_wsgi and 
configure it for my django Application but I am getting errors when I start 
httpd.  Any help is appreciated.... I've been hammering away at this most 
of the day unfortunately.

Documentation:
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/modwsgi/ 
https://modwsgi.readthedocs.io/en/develop/user-guides/quick-installation-guide.html

httpd.conf:
LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / /home/django/portal/sec_web/sec_web/wsgi.py
WSGIPythonHome /home/django/portal/env
WSGIPythonPath /home/django/portal/sec_web

<Directory /home/django/portal/sec_web/sec_web>
    <Files wsgi.py>
        Require all granted
    </Files>
</Directory>

Directory structure (Portal is just a directory for organization my project 
is sec_web):
portal
├── env
│   ├── bin
│   │   ├── activate
│   │   ├── activate.csh
│   │   ├── activate.fish
│   │   ├── Activate.ps1
│   │   ├── mod_wsgi-express
│   │   ├── pip
│   │   ├── pip3
│   │   ├── pip3.9
│   │   ├── python -> python3
│   │   ├── python3 -> /bin/python3
│   │   └── python3.9 -> python3
│   ├── include
│   ├── lib
│   │   └── python3.9
│   ├── lib64 -> lib
│   └── pyvenv.cfg
└── sec_web
    ├── api
    │   ├── admin.py
    │   ├── apps.py
    │   ├── __init__.py
    │   ├── migrations
    │   ├── models.py
    │   ├── __pycache__
    │   ├── serializers.py
    │   ├── tests.py
    │   ├── urls.py
    │   └── views.py
    ├── db.sqlite3
    ├── endpoint
    │   ├── admin.py
    │   ├── apps.py
    │   ├── __init__.py
    │   ├── migrations
    │   ├── models.py
    │   ├── __pycache__
    │   ├── tests.py
    │   ├── urls.py
    │   └── views.py
    ├── logfile.log
    ├── logfile.log.bak
    ├── manage.py
    ├── requirements.txt
    ├── sec_web
    │   ├── asgi.py
    │   ├── __init__.py
    │   ├── migrations
    │   ├── __pycache__
    │   ├── settings.py
    │   ├── urls.py
    │   ├── utils.py
    │   └── wsgi.py
    └── urls.py

/var/log/httpd/error_log:
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x00007fc56a8de540 (most recent call first):
<no Python frame>
Python path configuration:
  PYTHONHOME = '/home/django/portal/env'
  PYTHONPATH = (not set)
  program name = 'python3'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python3'
  sys.base_prefix = '/home/django/portal/env'
  sys.base_exec_prefix = '/home/django/portal/env'
  sys.platlibdir = 'lib64'
  sys.executable = '/usr/bin/python3'
  sys.prefix = '/home/django/portal/env'
  sys.exec_prefix = '/home/django/portal/env'
  sys.path = [
    '/home/django/portal/env/lib64/python39.zip',
    '/home/django/portal/env/lib64/python3.9',
    '/home/django/portal/env/lib64/python3.9/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
/var/log/httpd/error_log


-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/modwsgi/1b7e6f7e-daae-4ff6-849e-529ca0055355n%40googlegroups.com.

Reply via email to