R
Railway12mo ago
Tisco

I need help Build error constantly occurs when i want to deploy my django app

Project id : 08f5670b-7f06-4fa9-9f77-c30234095737
No description
40 Replies
Percy
Percy12mo ago
Project ID: 08f5670b-7f06-4fa9-9f77-c30234095737
Tisco
TiscoOP12mo ago
Brody
Brody12mo ago
what version of python are you using locally?
Tisco
TiscoOP12mo ago
3.11.3
Brody
Brody12mo ago
add a runtime.txt file to your project with 3.11.3 in it
Tisco
TiscoOP12mo ago
In the project's root folder?
Brody
Brody12mo ago
if thats what you have railway set to, yes
Tisco
TiscoOP12mo ago
ok the same error still occurs
Brody
Brody12mo ago
build logs again please
Brody
Brody12mo ago
this is a completely different error send your requirements.txt file please
Brody
Brody12mo ago
are you using twisted-iocpsupport in your code?
Tisco
TiscoOP12mo ago
No i don't think so
Brody
Brody12mo ago
then please remove all packages you arent using from your requirements.txt
Tisco
TiscoOP12mo ago
alright The deployment was succesfull thanks alot
Brody
Brody12mo ago
no problem!!
Tisco
TiscoOP12mo ago
Hello again. How do i configure my project to use asgi rather than wsgi because my project is asyncronous
Brody
Brody12mo ago
how would you do that locally? you tell me how you'd do it locally, I'll tell you how you'd do it on railway
Tisco
TiscoOP12mo ago
i just add ASGI_APPLICATION in my settings.py file and i use daphne server
Brody
Brody12mo ago
alright, gonna need more information than that though, what daphne command would you run to start your app
Tisco
TiscoOP12mo ago
the normal python manage.py runserver and it automatically uses the daphne server
Brody
Brody12mo ago
I don't believe that's what you'd do in a production environment though runserver is purely for development use please provide a daphne command that would start your app
Tisco
TiscoOP12mo ago
daphne Habii.asgi:application
Brody
Brody12mo ago
that looks good, do you have daphne in your requirements.txt file?
Tisco
TiscoOP12mo ago
yeah
Brody
Brody12mo ago
do you have a Procfile?
Tisco
TiscoOP12mo ago
yeah
Brody
Brody12mo ago
please send the contents of that file
Tisco
TiscoOP12mo ago
web: gunicorn Habii.wsgi
Brody
Brody12mo ago
okay one sec, I'll get you the new daphne command to replace that with web: daphne Habii.asgi:application --bind 0.0.0.0 --port $PORT give that a try and let me know how it goes
Tisco
TiscoOP12mo ago
alright
Brody
Brody12mo ago
quick question, have you confirmed that running your application locally with daphne (not runserver) works as intended?
Tisco
TiscoOP12mo ago
let me check It doesnot run as intended locally
Brody
Brody12mo ago
you can't make concurrent requests?
Tisco
TiscoOP12mo ago
the server refuses to run it outputs some errors
Brody
Brody12mo ago
must have given me an incorrect start command, what issues do you run into with gunicorn
Tisco
TiscoOP12mo ago
The command is correct it is from django docs but the error is clearly from my end since the server doesn't even run locally
Brody
Brody12mo ago
ah okay, makes sense
Want results from more Discord servers?
Add your server