fix github 3

This commit is contained in:
Flatlogic Bot 2026-02-13 05:38:22 +00:00
parent 51822816f6
commit caed5f0227
6 changed files with 36 additions and 0 deletions

6
Aptfile Normal file
View File

@ -0,0 +1,6 @@
libgobject-2.0-0
libpango-1.0-0
libcairo2
libharfbuzz0b
libfontconfig1
libpangoft2-1.0-0

1
Procfile Normal file
View File

@ -0,0 +1 @@
web: gunicorn config.wsgi --log-file -

View File

@ -22,6 +22,20 @@ except ImportError:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
# Patch for WeasyPrint libraries
try:
import ctypes
import ctypes.util
for lib in ['gobject-2.0', 'pango-1.0', 'cairo', 'harfbuzz', 'fontconfig']:
path = ctypes.util.find_library(lib)
if path:
try:
ctypes.CDLL(path)
except OSError:
pass
except Exception:
pass
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

View File

@ -15,6 +15,21 @@ def main():
pass
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings')
# Patch for WeasyPrint libraries
try:
import ctypes
import ctypes.util
for lib in ['gobject-2.0', 'pango-1.0', 'cairo', 'harfbuzz', 'fontconfig']:
path = ctypes.util.find_library(lib)
if path:
try:
ctypes.CDLL(path)
except OSError:
pass
except Exception:
pass
try:
from django.core.management import execute_from_command_line
except ImportError as exc: