Issue with deploying Django application, requirements.txt

ekim-67HOBBY

a year ago

I am trying to deploy a simple django application to Railway, but keep running into this issue:

5.606 ERROR: Ignored the following versions that require a different python version: 5.0 Requires-Python >=3.10; 5.0.1 Requires-Python >=3.10; 5.0a1 Requires-Python >=3.10; 5.0b1 Requires-Python >=3.10; 5.0rc1 Requires-Python >=3.10

5.606 ERROR: Could not find a version that satisfies the requirement Django==5.0 (from versions: 1.1.3, 1.1.4, 1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.3, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.3.6, 1.3.7 … 4.2.9)

5.606 ERROR: No matching distribution found for Django==5.0

ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1

Error: Docker build failed

My requirements.txt file is:

asgiref==3.7.2
crispy-bootstrap4==2023.1
Django==5.0
django-crispy-forms==2.1
gunicorn==21.2.0
packaging==23.2
Pillow==10.1.0
pytz==2023.3.post1
sqlparse==0.4.4

My Procfile is:

web: gunicorn django_net.wsgi --log-file -

my runtime.txt file is:

python-3.12.1

I am very new to deploying so I have no idea what I'm doing wrong here. Any help would be appreciated.

Solved

3 Replies

a year ago

nixpacks does not yet support python 3.12, set your runtime.txt to Python 3.11


ekim-67HOBBY

a year ago

Thanks, the build is now working. However, I am now getting an error with my deployment:

File "/root/.nix-profile/lib/python3.11/importlib/init.py", line 126, in import_module

return bootstrap.gcd_import(name[level:], package, level)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "", line 1204, in gcdimport

File "", line 1176, in findand_load

File "", line 1126, in findandloadunlocked

File "", line 241, in callwithframesremoved

File "", line 1204, in gcdimport

File "", line 1176, in findand_load

File "", line 1140, in findandloadunlocked

ModuleNotFoundError: No module named 'name-of-application'

[2024-01-25 21:10:49 +0000] [10] [INFO] Worker exiting (pid: 10)

[2024-01-25 21:10:49 +0000] [7] [ERROR] Worker (pid:10) exited with code 3

[2024-01-25 21:10:49 +0000] [7] [ERROR] Shutting down: Master

[2024-01-25 21:10:49 +0000] [7] [ERROR] Reason: Worker failed to boot.


a year ago

ModuleNotFoundError: No module named 'name-of-application'

this would be a code issue, perhaps some left over unused imports


Status changed to Closed brody 4 months ago


Issue with deploying Django application, requirements.txt - Railway Help Station