ModuleNotFoundError: No module named 'macelleria_progetto.settings'

I’m trying to deploy a django on Linux server (AWS Lightsail Bitnami ) .

I’ve loaded the data and set the conf file in apache (using mod-wsgi).
But don’t work.
In the server_error (logs) the error is:

[wsgi:error] [pid 16260] [remote 79.52.250.157:63175]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[wsgi:error] [pid 16260] [remote 79.52.250.157:63175]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[wsgi:error] [pid 16260] [remote 79.52.250.157:63175]   File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
[wsgi:error] [pid 16260] [remote 79.52.250.157:63175] ModuleNotFoundError: No module named 'macelleria_progetto.settings'
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497] mod_wsgi (pid=16259): Failed to exec Python script file '/opt/bitnami/projects/macelleria_sito1/macelleria_progetto/macelleria_progetto/wsgi.py'.
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497] mod_wsgi (pid=16259): Exception occurred processing WSGI script '/opt/bitnami/projects/macelleria_sito1/macelleria_progetto/macelleria_progetto/wsgi.py'.
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497] Traceback (most recent call last):
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/projects/macelleria_sito1/macelleria_progetto/macelleria_progetto/wsgi.py", line 13, in <module>
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     application = get_wsgi_application()
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/apache/htdocs/projects/macelleria_env/lib/python3.8/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     django.setup(set_prefix=False)
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/apache/htdocs/projects/macelleria_env/lib/python3.8/site-packages/django/__init__.py", line 19, in setup
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/apache/htdocs/projects/macelleria_env/lib/python3.8/site-packages/django/conf/__init__.py", line 82, in __getattr__
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     self._setup(name)
[pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/apache/htdocs/projects/macelleria_env/lib/python3.8/site-packages/django/conf/__init__.py", line 69, in _setup
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     self._wrapped = Settings(settings_module)
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/apache/htdocs/projects/macelleria_env/lib/python3.8/site-packages/django/conf/__init__.py", line 170, in __init__
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     mod = importlib.import_module(self.SETTINGS_MODULE)
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "/opt/bitnami/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]     return _bootstrap._gcd_import(name[level:], package, level)
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "<frozen importlib._bootstrap>", line 991, in _find_and_load
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497]   File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
[wsgi:error] [pid 16259] [remote 79.52.250.157:63497] ModuleNotFoundError: No module named 'macelleria_progetto.settings'

How I can resolve this ? I have to edit ‘wsgi.py’ file ?

‘macelleria_progetto’ IS THE NAME OF PROJECT, NOT AN APP !

p.s: here my v-vhost file in apache :

<IfDefine !IS_macelleria_sito1_LOADED>

Define IS_macelleria_sito1_LOADED

WSGIDaemonProcess macelleria_sito1 python-home=/opt/bitnami/apache/htdocs/projects/macelleria_env python-path=/opt/bitnami/projects/macelleria_sito1 processes=2 threads$

</IfDefine>

<VirtualHost *:443 _default_:443>

ServerAlias *

SSLEngine on

SSLCertificateFile "/etc/letsencrypt/aa/aa/aa"

SSLCertificateKeyFile "/etc/letsencrypt/live/aa/aa/aa"

WSGIProcessGroup macelleria_sito1

Alias /robots.txt /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/static/robots.txt

Alias /favicon.ico /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/static/favicon.ico

Alias /static/ /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/static/

<Directory /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/static>

Require all granted

</Directory>

Alias /media/ /opt/bitnami/projects/macelleria_sito1/media/

<Directory /opt/bitnami/projects/macelleria_sito1/media>

Require all granted

</Directory>

WSGIScriptAlias / /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/macelleria_progetto/wsgi.py

<Directory /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/macelleria_progetto>

<Files wsgi.py>

Require all granted

</Files>

</Directory>

</VirtualHost>

This is the key line from the traceback - for whatever reason, it’s not finding your settings.py file.

Is your settings.py file in /opt/bitnami/projects/macelleria_sito1/macelleria_progetto/ ?
If not, what directory is it located in? (According to the error message, that’s the directory where it’s expecting to find it.)