failing to deploy a django project from github

florianHOBBY

9 months ago

My Django project deploys with these errors:
[Region: us-west1]

==============

Using Nixpacks

==============

context: fdfd8eae2ac9cb9d425030f1b2a7aed6

Nixpacks build failed

╔══════════════════════════════ Nixpacks v1.26.0 ══════════════════════════════╗

║ setup │ python312, postgresql, gcc ║

║──────────────────────────────────────────────────────────────────────────────║

║ install │ python -m venv --copies /opt/venv && . /opt/venv/bin/activate ║

║ │ && pip install -r requirements.txt ║

║──────────────────────────────────────────────────────────────────────────────║

║ start │ ║

╚══════════════════════════════════════════════════════════════════════════════╝

Error: No start command could be found

I verified that I have gunicorn with 'pip show gunicorn'
I also have a single Procfile with these contents:
web: gunicorn store.wsgi --log-file
web: python manage.py migrate && gunicorn store.wsg

verified that the app name is 'store' by going to apps.py
Also wanted to add that the procfile is spelt as 'Procfile' in my root directory and I also have V2 builder turned off.

here's the requirements.txt also:
asgiref==3.8.1
Django==5.1
gunicorn==23.0.0
packaging==24.1
pillow==10.4.0
psycopg2==2.9.9
python-dotenv==1.0.1
sqlparse==0.5.1
typing_extensions==4.12.2
tzdata==2024.1
whitenoise==6.7.0

and runtime.txt:
python 3.12.3

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

7 Replies

9 months ago

You would need a Procfile (capital P) with just this in it -

web: python manage.py migrate && gunicorn store.wsg && gunicorn store.wsgi --log-file -

florianHOBBY

9 months ago

Using the procfile you sent: "web: python manage.py migrate && gunicorn store.wsg && gunicorn store.wsgi --log-file -"

dployment is successful, however going to the site i get an error "Application failed to respond"

checking the log i see:

"python: can't open file '/app/manage.py': [Errno 2] No such file or directory

container event container died"

i then changed the procfile to: "web: python ecom/manage.py migrate && gunicorn store.wsg && gunicorn store.wsgi --log-file -"

but then it crashes and logs give: "container event container died"

I have a feeling its an issue with the layout of my directory but not sure how to tackle that

my directory layout is as follows:

C:\****\****\****\****\****\ecom>dir /b

.env

.gitignore

ecom

Procfile

README.md

requirements.txt

runtime.txt

venv

C:\****\****\****\****\****\ecom\ecom>dir /b

cart

db.sqlite3

ecom

manage.py

media

payment

static

staticfiles

store


9 months ago

Please share your repo.


florianHOBBY

9 months ago

https://github.com/tab1shh/ecom


9 months ago

Try bringing the contents of the ecom folder into the root.


florianHOBBY

9 months ago

getting a "ModuleNotFoundError: No module named 'store.wsg'" perhaps i need to edit the Procfile?


fauzaanuPRO

9 months ago

store is not a project directory with a wsgi.py file. your project dirs name is ecom so it should be ecom.wsgi. Sent a PR btw.