Почему vercel выдает ошибку при развертывании на нем приложения django
Я пытаюсь развернуть свое Django-приложение на Vercel, следуя методу, описанному в видеоуроке. Однако в процессе сборки происходит ошибка. К сожалению, я не могу определить причину этой ошибки. Не мог бы кто-нибудь, хорошо разбирающийся в этом процессе развертывания, указать, где я мог ошибиться?
Журналы:
WARN! Due to `builds` existing in your configuration file, the Build and Development Settings defined in your Project Settings will not apply. Learn More: https://vercel.link/unused-build-settings
Installing required dependencies...
Failed to run "pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt"
Error: Command failed: pip3.9 install --disable-pip-version-check --target . --upgrade -r /vercel/path0/requirements.txt
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [21 lines of output]
running egg_info
writing psycopg2.egg-info/PKG-INFO
writing dependency_links to psycopg2.egg-info/dependency_links.txt
writing top-level names to psycopg2.egg-info/top_level.txt
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
If you prefer to avoid building psycopg2 from source, please install the PyPI
'psycopg2-binary' package instead.
For further information please check the 'doc/src/install.rst' file (also at
<https://www.psycopg.org/docs/install.html>).
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
requirements.txt:
asgiref==3.8.1
beautifulsoup4==4.12.3
crispy-bootstrap5==2024.2
Django==4.2.11
django-bootstrap-v5==1.0.11
django-crispy-forms==2.1
django-tinymce==3.7.1
gunicorn==21.2.0
packaging==24.0
pillow==10.2.0
psycopg2==2.9.9
psycopg2-binary==2.9.9
soupsieve==2.5
sqlparse==0.4.4
tzdata==2024.1
settings.py:
ALLOWED_HOSTS = ['127.0.0.1', 'localhost', '.vercel.app', '.now.sh']
STATIC_ROOT = BASE_DIR / "staticfiles"
vercel.json:
{
"version": 2,
"builds": [
{
"src": "core/wsgi.py",
"use": "@vercel/python",
"config": { "maxLambdaSize": "15mb", "runtime": "python3.9" }
}],
"routes": [
{
"src": "/(.*)",
"dest": "core/wsgi.py"
}
]
}
build_files.sh:
pip install -r requirements.txt
python3.9 manage.py collectstatic --noinput