AWS lightsail django статические файлы не загружаются с помощью apache

Я создал проект django в AWS lightsail, который использует bitnami. Я смог загрузить свой проект, но когда я попытался получить доступ к нему с публичного ip-адреса, который мне дали, он выдал некоторую ошибку в браузере, и в журнале ошибок было

Exception ignored in: <function Local.__del__ at 0x7f923d359550>
Traceback (most recent call last):
  File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__
NameError: name 'TypeError' is not defined
Exception ignored in: <function Local.__del__ at 0x7f923d359550>
Traceback (most recent call last):
  File "/opt/bitnami/python/lib/python3.8/site-packages/asgiref/local.py", line 96, in __del__
NameError: name 'TypeError' is not defined
[Thu Dec 02 08:25:01.082092 2021] [mpm_event:notice] [pid 18334:tid 140267253222272] AH00491: caught SIGTERM, shutting down
[Thu Dec 02 08:25:01.259848 2021] [ssl:warn] [pid 18855:tid 140702045899648] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Dec 02 08:25:01.269998 2021] [ssl:warn] [pid 18856:tid 140702045899648] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Dec 02 08:25:01.270771 2021] [mpm_event:notice] [pid 18856:tid 140702045899648] AH00489: Apache/2.4.51 (Unix) OpenSSL/1.1.1d mod_wsgi/4.7.1 Python/3.8 configured -- resuming normal operations
[Thu Dec 02 08:25:01.270797 2021] [core:notice] [pid 18856:tid 140702045899648] AH00094: Command line: '/opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf'
[Thu Dec 02 08:25:16.600738 2021] [authz_core:error] [pid 18858:tid 140701463279360] [client 185.220.101.170:29682] AH01630: client denied by server configuration: /opt/bitnami/projects/myproject/static/plugins/fontawesome-free/css/all.min.css, referer: http://public_ipaddres/
[Thu Dec 02 08:25:16.898619 2021] [authz_core:error] [pid 19143:tid 140701358606080] [client 185.220.101.170:16764] AH01630: client denied by server configuration: /opt/bitnami/projects/myproject/static/plugins/select2/css/select2.min.css, referer: http://public_ipaddres/
[Thu Dec 02 08:25:16.899763 2021] [authz_core:error] [pid 18859:tid 140701463279360] [client 185.220.101.170:21798] AH01630: client denied by server configuration: /opt/bitnami/projects/myproject/static/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css, referer: http://public_ipaddres/

Пожалуйста, что я могу сделать, чтобы заставить программу работать. Я выполнил все соответствующие вопросы в stackoverflow, но не могу добиться прогресса.

Вот мой bitnami.conf

<VirtualHost _default_:80>
    WSGIScriptAlias / /opt/bitnami/projects/myproject/wsgi.py
 
    <Directory /opt/bitnami/projects/myproject/>
        AllowOverride all
        Require all granted
        Options FollowSymlinks
    </Directory>
 
    DocumentRoot /opt/bitnami/projects/myproject/
    Alias /static/ /opt/bitnami/projects/myproject/static/
</VirtualHost>
 
Include "/opt/bitnami/apache/conf/bitnami/bitnami-ssl.conf"

вот мой httpd-app.conf

<IfDefine !IS_DJANGOSTACK_LOADED>
      Define IS_DJANGOSTACK_LOADED
      WSGIDaemonProcess wsgi-djangostack   processes=2 threads=15    display-name=%{GROUP}
</IfDefine>

<Directory "/opt/bitnami/projects/myproject">
    Options +MultiViews
    AllowOverride All
    <IfVersion >= 2.3>
        Require all granted
    </IfVersion>

    WSGIProcessGroup wsgi-djangostack

    WSGIApplicationGroup %{GLOBAL}
</Directory>

Alias /static/ '/opt/bitnami/projects/myproject/static/'
WSGIScriptAlias /myproject/ '/opt/bitnami/projects/myproject/wsgi.py'

Вот мой wsgi.py

import os

from django.core.wsgi import get_wsgi_application

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

application = get_wsgi_application()

В примере браузера ошибки выглядят так

Content Security Policy: The page’s settings blocked the loading of a resource at http://public_ipaddres/static/tinymce/tinymce.min.js (“script-src”).
Content Security Policy: The page’s settings blocked the loading of a resource at http://public_ipaddres/static/plugins/bootstrap/js/bootstrap.bundle.min.js (“script-src”).    

GET         http://public_ipaddres/static/plugins/fontawesome-free/css/all.min.css
Status      403 Forbidden
Version     HTTP/1.1

предупреждения являются

Content Security Policy: Couldn’t process unknown directive ‘script-src-elem’
Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen

Я пробовал это в течение нескольких дней.

Вернуться на верх