Skip to content

WSGI invocation fails #585

@handshape

Description

@handshape

Hi there - I have need to deploy blawx at a URL offset from the root of the server. The usual way to do this in django is to run it in a WSGI container with an offset, but when I invoke the existing wsgi.py using such a mapping, (after installing all the requirements) I get the following:

[Thu Mar 07 15:35:20.608652 2024] [wsgi:error] [REDACTED] mod_wsgi (pid=7225): Failed to exec Python script file '/var/www/html/blawx/blawx/wsgi.py'.
[Thu Mar 07 15:35:20.608720 2024] [wsgi:error] [REDACTED] mod_wsgi (pid=7225): Exception occurred processing WSGI script '/var/www/html/blawx/blawx/wsgi.py'.
[Thu Mar 07 15:35:20.609204 2024] [wsgi:error] [REDACTED] Traceback (most recent call last):
[Thu Mar 07 15:35:20.609276 2024] [wsgi:error] [REDACTED]   File "/var/www/html/blawx/blawx/wsgi.py", line 16, in <module>
[Thu Mar 07 15:35:20.609290 2024] [wsgi:error] [REDACTED]     application = get_wsgi_application()
[Thu Mar 07 15:35:20.609301 2024] [wsgi:error] [REDACTED]   File "/usr/local/lib/python3.10/dist-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[Thu Mar 07 15:35:20.609308 2024] [wsgi:error] [REDACTED]     django.setup(set_prefix=False)
[Thu Mar 07 15:35:20.609317 2024] [wsgi:error] [REDACTED]   File "/usr/local/lib/python3.10/dist-packages/django/__init__.py", line 19, in setup
[Thu Mar 07 15:35:20.609324 2024] [wsgi:error] [REDACTED]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[Thu Mar 07 15:35:20.609331 2024] [wsgi:error] [REDACTED]   File "/usr/local/lib/python3.10/dist-packages/django/conf/__init__.py", line 89, in __getattr__
[Thu Mar 07 15:35:20.609337 2024] [wsgi:error] [REDACTED]     self._setup(name)
[Thu Mar 07 15:35:20.609345 2024] [wsgi:error] [REDACTED]   File "/usr/local/lib/python3.10/dist-packages/django/conf/__init__.py", line 76, in _setup
[Thu Mar 07 15:35:20.609351 2024] [wsgi:error] [REDACTED]     self._wrapped = Settings(settings_module)
[Thu Mar 07 15:35:20.609358 2024] [wsgi:error] [REDACTED]   File "/usr/local/lib/python3.10/dist-packages/django/conf/__init__.py", line 190, in __init__
[Thu Mar 07 15:35:20.609364 2024] [wsgi:error] [REDACTED]     mod = importlib.import_module(self.SETTINGS_MODULE)
[Thu Mar 07 15:35:20.609371 2024] [wsgi:error] [REDACTED]   File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
[Thu Mar 07 15:35:20.609377 2024] [wsgi:error] [REDACTED]     return _bootstrap._gcd_import(name[level:], package, level)
[Thu Mar 07 15:35:20.609384 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[Thu Mar 07 15:35:20.609392 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[Thu Mar 07 15:35:20.609399 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
[Thu Mar 07 15:35:20.609427 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[Thu Mar 07 15:35:20.609435 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
[Thu Mar 07 15:35:20.609443 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
[Thu Mar 07 15:35:20.609451 2024] [wsgi:error] [REDACTED]   File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
[Thu Mar 07 15:35:20.609470 2024] [wsgi:error] [REDACTED] ModuleNotFoundError: No module named 'blawx'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions