#Application Error Is your app correctly listening on $PORT? Django Application

39 messages · Page 1 of 1 (latest)

twin socket
#

I'm trying to deploy a django application, during the procedure no errors are reported, but when I access the link the website returns the following error: Application Error Is your app correctly listening on $PORT?
I ping the site by the url and I got a response.
The migrates were run without problems, including the data has already been restored in the database.

Has anyone had a similar problem?

brave cape
#

make sure that you have set your PORT environment variable in the project to whatever your django app is listening on (default is 8000 iirc)

also, it looks like in the deploy logs it never started? it just ran migrations. it should say something about starting up and listening on 0.0.0.0:8000

twin socket
brave cape
#

in the message you sent above there is, is this a fresh redeploy?

twin socket
brave cape
#

ok, then just make sure you have the PORT environment variable for your project set to 8000 or whatever you have Django configured to use

twin socket
brave cape
twin socket
brave cape
brave cape
#

so then you just need to make sure that your django project is actually up and running, there should be something in the deploy logs.

if possible could you send me a github repo? perhaps it's something with the configuration preventing it from starting properly

amber whale
#

hey Jackson,
I am also facing the same error.
facing this issue from last 4 days, unable to make it up.
please guide

#

rest of the things are working completely fine

brave cape
amber whale
#

ok.
thank you

#

@twin socket , did you get any luck ?

twin socket
#

not yet. I put in the start command the command 'python manage.py runserver 8000' and returned the following message

amber whale
#

have you done this?

twin socket
# amber whale have you done this?

Not yet. I'm not in front of the computer anymore. As soon as it is, I'll try. In allowed_hosts there is only the address xxx.up.railway.app

twin socket
# amber whale have you done this?

I made the changes you suggested in settings.py and it remains the same.

If I run the command "python manage.py runserver 8000", the server returns the error "Application Error Is your app correctly listening on $PORT?"

If I run the command "python manage.py runserver 0.0.0.0:8000" the log gives me the error "INFO "GET / HTTP/1.1" 301 0"

raw orchid
#

i believe railway provides it

raw orchid
#
cmd = 'python manage.py migrate && gunicorn -b 0.0.0.0:$PORT --max-requests 1000 --workers 5 --threads 2 [appname].wsgi'```
twin socket
twin socket
raw orchid
#

go to your build logs, what do you see here?

twin socket
raw orchid
#

oh hmm

#

i domt have much experience with dockerfile configs

shy thistle
#

Looks to me like you have a dockerfile in there that’s messing everything up

shy thistle
#

This is not your thread, please make your own for your question

twin socket
shy thistle
#

please send your repo

twin socket
# shy thistle please send your repo

I can't share the repo with you because of work regulations, but if you tell me the excerpt you'd like to see, I'll copy it and send it to you.

shy thistle