DJANGO + FIREBASE deployment with ssl certificate

I am currently deploying a django project that uses firebase_admin. at first when it was just deployed i can access it smoothly when it was just an ip provided by amazon aws. but when i used the bought ssl certificate and domain, after setting up everything, it now returns internal error 500 when i am trying to use from firebase_admin import messaging.

but when i comment out everything about firebase, the website works. when i looked in the error logs it says no module _ssl

i tried everything(i think). tried rebuilding python remaking virtualenv installing libssl almost everything that i saw on the internet while searching but nothing has worked yet

in my django views.py

when I do this
import firebase_admin

from firebase_admin import credentials

it's fine like the site will work

but when i do it like this
import firebase_admin

from firebase_admin import credentials, messaging
i get this error in the apache2 error log

[Thu Feb 13 08:52:34.813237 2025] [wsgi:error] [pid 1687181:tid 1687236] [remote xxx.xxx.x.xx:xxxxx] import ssl

[Thu Feb 13 08:52:34.813243 2025] [wsgi:error] [pid 1687181:tid 1687236] [remote xxx.xxx.x.xx:xxxxx] File "/opt/bitnami/python/lib/python3.11/ssl.py", line 100, in <module>

[Thu Feb 13 08:52:34.813246 2025] [wsgi:error] [pid 1687181:tid 1687236] [remote xxx.xxx.x.xx:xxxxx] import _ssl # if we can't import it, let the error propagate

[Thu Feb 13 08:52:34.813250 2025] [wsgi:error] [pid 1687181:tid 1687236] [remote xxx.xxx.x.xx:xxxxx] ^^^^^^^^^^^

[Thu Feb 13 08:52:34.813260 2025] [wsgi:error] [pid 1687181:tid 1687236] [remote xxx.xxx.x.xx:xxxxx] ModuleNotFoundError: No module named '_ssl'

this is how my .conf is configured

 WSGIDaemonProcess chatteronline.co python-home=/home/bitnami/chatter-api/CHATTER1/Admin_web/newchatter/myenv python-path=/home/bitnami/chatter-api/CHATTER1/Admin_web/newchatter
        WSGIProcessGroup chatteronline.co
        WSGIApplicationGroup %{GLOBAL}
        WSGIScriptAlias / /home/bitnami/chatter-api/CHATTER1/Admin_web/newchatter/web/wsgi.py
Вернуться на верх