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
Project ID:
5f54a531-af23-4012-970e-77620099608d
5f54a531-af23-4012-970e-77620099608d
any help <:blob_help:1149662715409874944>
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
no worries
updated the message
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
what version of python do you use locally?
Python 3.10.12
how do you manage your deps?
the project is working fine with gunicorn but when i use daphne i get this error
you mean statics and media ?
python modules
requirements.txt?
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
add a runtime.txt file to your project with
3.10
in itokay testing
can you run your app locally with Daphne?
yea
its working fine
and its working fine if i deploy and run with gunicorn
so adding the runtime.txt did nothing?
im redeploying
python-3.10.12
or python 3.10
or 3.10
i deployed it with 3.10 only and its same errorbuild logs please
build please
okay my next recommendation would be to pin all the deps in your requirements.txt file to the version you have installed locally
okay
im redoploying it takes time thanks for your time
send your new requirements.txt file?
its taking forever is that normal 😄
8 min deplying
is a heathcheck failing?
this is build waiting deploy
okay let me know when it goes through
FAILED
Deployment Failed during build process
whats in the logs?
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
thats not good
railway issue
redeploy?
it happen before to me and i redeployed it works
sure
also, why use daphne instead of gunicorn?
channels
you mean websockets?
yea
gunicorn cant to websockets?
i think asgi need dephne
it deployed but same error
okay, have you tried to do research on this issue? this isnt an issue relating to railway
i did and i found nothing because its working fine on my local
thats sad really
please look harder, this is likely just a code issue
ok thank you for your time
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
did that solve it though?
it did for me
awsome!
but he needs to try it first
I had that one about two months ago
problem solved, job done 🤣
the url patterns load before the app so it crashes it
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
i solved it too