#Asgi:daphne

74 messages · Page 1 of 1 (latest)

marsh canopy
#

i got this error when i run server

File "/opt/venv/lib/python3.8/site-packages/django/apps/registry.py", line 138, in check_apps_ready

raise AppRegistryNotReady("Apps aren't loaded yet.")

django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.

it works fine but when i deploy i got this error

untold cloakBOT
#

Project ID: 5f54a531-af23-4012-970e-77620099608d

marsh canopy
#

5f54a531-af23-4012-970e-77620099608d

marsh canopy
#

any help blob_help

hexed oar
hexed oar
#

oh shit, I linked the wrong thing, I'm so sorry

marsh canopy
#

no worries

hexed oar
#

updated the message

marsh canopy
#

the problem is its working fine on my pc but when i deploy i get this

#

this my start command daphne project.asgi:application -b 0.0.0.0 -p $PORT

hexed oar
#

what version of python do you use locally?

marsh canopy
#

Python 3.10.12

hexed oar
#

how do you manage your deps?

marsh canopy
#

the project is working fine with gunicorn but when i use daphne i get this error

marsh canopy
hexed oar
#

python modules

#

requirements.txt?

marsh canopy
#

wheel
aiohttp==3.8.4
aiosignal==1.3.1
asgiref==3.5.2
async-timeout==4.0.2
attrs==22.2.0
beautifulsoup4==4.11.1
certifi==2022.6.15
charset-normalizer==2.1.1
crispy-bootstrap5==0.6
Django==4.1
django-cors-headers==3.13.0
django-crispy-forms==1.14.0
django-environ==0.9.0
django-extensions==3.1.3
django-filter==22.1
django-htmx==1.12.2
django-jazzmin==2.5.0
django-jet-reboot==1.3.1
django-ninja==0.19.1
django-smtp-ssl==1.0
django-widget-tweaks==1.4.12
djangorestframework==3.13.1
frozenlist==1.3.3
gunicorn==20.1.0
idna==3.3
multidict==6.0.4
numpy==1.24.2
openai==0.26.5
opencv-contrib-python-headless
pdfkit==1.0.0
Pillow==9.2.0
psycopg2-binary==2.9.3
pydantic==1.10.2
pytz==2022.2.1
PyYAML==6.0
requests==2.28.1
six==1.16.0
socialmediaapi==0.0.2
soupsieve==2.3.2.post1
sqlparse==0.4.2
tqdm==4.64.1
typing_extensions==4.3.0
urllib3==1.26.12
yarl==1.8.2
whitenoise
django-celery-beat
celery==4.4.7
redis
django-resized
boto3
django-storages
django-cleanup
cryptography
sweetify
django-resized
daphne
channels
channels-redis

hexed oar
#

add a runtime.txt file to your project with 3.10 in it

marsh canopy
#

okay testing

hexed oar
#

can you run your app locally with Daphne?

marsh canopy
#

yea

#

its working fine

#

and its working fine if i deploy and run with gunicorn

hexed oar
#

so adding the runtime.txt did nothing?

marsh canopy
#

im redeploying

#

python-3.10.12 or python 3.10 or 3.10

#

i deployed it with 3.10 only and its same error

hexed oar
#

build logs please

marsh canopy
hexed oar
#

build please

marsh canopy
hexed oar
#

okay my next recommendation would be to pin all the deps in your requirements.txt file to the version you have installed locally

marsh canopy
#

okay

#

im redoploying it takes time thanks for your time

hexed oar
#

send your new requirements.txt file?

marsh canopy
#

its taking forever is that normal 😄

#

8 min deplying

hexed oar
#

is a heathcheck failing?

marsh canopy
#

this is build waiting deploy

hexed oar
#

okay let me know when it goes through

marsh canopy
#

FAILED

Deployment Failed during build process

hexed oar
#

whats in the logs?

marsh canopy
hexed oar
#

thats not good

#

railway issue

marsh canopy
#

redeploy?

#

it happen before to me and i redeployed it works

hexed oar
#

sure

#

also, why use daphne instead of gunicorn?

marsh canopy
#

channels

hexed oar
#

you mean websockets?

marsh canopy
#

yea

hexed oar
#

gunicorn cant to websockets?

marsh canopy
#

i think asgi need dephne

#

it deployed but same error

hexed oar
#

okay, have you tried to do research on this issue? this isnt an issue relating to railway

marsh canopy
#

i did and i found nothing because its working fine on my local

#

thats sad really

hexed oar
#

please look harder, this is likely just a code issue

marsh canopy
#

ok thank you for your time

misty cairn
#

I think I've had this one

#

django_asgi_app = get_asgi_application()

#

this line

#

makes sure you put it before this line from members.routing import websocket_urlpatterns

hexed oar
#

did that solve it though?

misty cairn
#

it did for me

hexed oar
#

awsome!

misty cairn
#

but he needs to try it first

#

I had that one about two months ago

hexed oar
#

problem solved, job done 🤣

misty cairn
#

the url patterns load before the app so it crashes it