static and media files not working in cpanel shared hosting

then my debug=False my static files stop working
these are the important files
.htaccess

# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION BEGIN
PassengerAppRoot "/home/legaumab/legalsync"
PassengerBaseURI "/"
PassengerPython "/home/legaumab/virtualenv/legalsync/3.10/bin/python"
# DO NOT REMOVE. CLOUDLINUX PASSENGER CONFIGURATION END

# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION BEGIN
<IfModule Litespeed>
</IfModule>
# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION END

# Serve static files
# Alias /static/ /home/legaumab/legalsync/static/
# <Directory /home/legaumab/legalsync/static>
#     Require all granted
#     Options -Indexes
# </Directory>

# Serve static files
Alias /static/ /home/legaumab/legalsync/static/

<Directory /home/legaumab/legalsync/static>
    Require all granted
</Directory>

# Serve media files
Alias /media/ /home/legaumab/legalsync/media/

<Directory /home/legaumab/legalsync/media>
    Require all granted
</Directory>

# Redirect all other requests to the Django application
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /home/legaumab/legalsync/passenger_wsgi.py/$1 [QSA,L]

this is my setting.py

STATIC_URL = '/static/'

#STATICFILES_DIRS = [BASE_DIR / "static"]

STATIC_ROOT = os.path.join(BASE_DIR, 'static')

MEDIA_URL='/media/'

MEDIA_ROOT = BASE_DIR / 'media'

You need to ensure that apache has permission to the static and media directories, which may mean you need to grant permissions at higher directories. (It’s also why I always recommend that static and media directories reside completely outside the project directory.)

all permissions are granted already then to not working when i put static file and media files on public_html it is working but at the project directory it is not working i think there should be some changes in .htaccess