R
Railway•9mo ago
Filik

Asgi:daphne

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
53 Replies
Percy
Percy•9mo ago
Project ID: 5f54a531-af23-4012-970e-77620099608d
Filik
Filik•9mo ago
5f54a531-af23-4012-970e-77620099608d any help <:blob_help:1149662715409874944>
Brody
Brody•9mo ago
please use this to send your deployment logs https://bookmarklets.up.railway.app/log-downloader/ oh shit, I linked the wrong thing, I'm so sorry
Filik
Filik•9mo ago
no worries
Brody
Brody•9mo ago
updated the message
Filik
Filik•9mo ago
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
Brody
Brody•9mo ago
what version of python do you use locally?
Filik
Filik•9mo ago
Python 3.10.12
Brody
Brody•9mo ago
how do you manage your deps?
Filik
Filik•9mo ago
the project is working fine with gunicorn but when i use daphne i get this error you mean statics and media ?
Brody
Brody•9mo ago
python modules requirements.txt?
Filik
Filik•9mo ago
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
Brody
Brody•9mo ago
add a runtime.txt file to your project with 3.10 in it
Filik
Filik•9mo ago
okay testing
Brody
Brody•9mo ago
can you run your app locally with Daphne?
Filik
Filik•9mo ago
yea its working fine and its working fine if i deploy and run with gunicorn
Brody
Brody•9mo ago
so adding the runtime.txt did nothing?
Filik
Filik•9mo ago
im redeploying python-3.10.12 or python 3.10 or 3.10 i deployed it with 3.10 only and its same error
Brody
Brody•9mo ago
build logs please
Brody
Brody•9mo ago
build please
Brody
Brody•9mo ago
okay my next recommendation would be to pin all the deps in your requirements.txt file to the version you have installed locally
Filik
Filik•9mo ago
okay im redoploying it takes time thanks for your time
Brody
Brody•9mo ago
send your new requirements.txt file?
Filik
Filik•9mo ago
its taking forever is that normal 😄 8 min deplying
Brody
Brody•9mo ago
is a heathcheck failing?
Filik
Filik•9mo ago
this is build waiting deploy
Brody
Brody•9mo ago
okay let me know when it goes through
Filik
Filik•9mo ago
FAILED Deployment Failed during build process
Brody
Brody•9mo ago
whats in the logs?
Filik
Filik•9mo ago
Error response from daemon: manifest for us-west1.registry.rlwy.net/647cd965-90db-47fb-b5fd-258348de19a3:01101dbc-26d4-4399-a29b-a87ca1862bd8 not found: manifest unknown: manifest unknown
Brody
Brody•9mo ago
thats not good railway issue
Filik
Filik•9mo ago
redeploy? it happen before to me and i redeployed it works
Brody
Brody•9mo ago
sure also, why use daphne instead of gunicorn?
Filik
Filik•9mo ago
channels
Brody
Brody•9mo ago
you mean websockets?
Filik
Filik•9mo ago
yea
Brody
Brody•9mo ago
gunicorn cant to websockets?
Filik
Filik•9mo ago
i think asgi need dephne it deployed but same error
Brody
Brody•9mo ago
okay, have you tried to do research on this issue? this isnt an issue relating to railway
Filik
Filik•9mo ago
i did and i found nothing because its working fine on my local thats sad really
Brody
Brody•9mo ago
please look harder, this is likely just a code issue
Filik
Filik•9mo ago
ok thank you for your time
Iceman
Iceman•9mo ago
I think I've had this one The problem is in your asgi.py file django_asgi_app = get_asgi_application() this line makes sure you put it before this line from members.routing import websocket_urlpatterns
Brody
Brody•9mo ago
did that solve it though?
Iceman
Iceman•9mo ago
it did for me
Brody
Brody•9mo ago
awsome!
Iceman
Iceman•9mo ago
but he needs to try it first I had that one about two months ago
Brody
Brody•9mo ago
problem solved, job done 🤣
Iceman
Iceman•9mo ago
the url patterns load before the app so it crashes it
Filik
Filik•8mo ago
oh i just logged to discord to write how to solve it and found you mentions the right way to solve it you right thank you anyway for help @Iceman
i solved it too