Aug 06 11:11:00 ip-172-31-12-99 python[92893]: File "/home/ubuntu/nextshelters/env/lib/python3.10/site-packages/django/conf/init.py", line 72, in _setup Aug 06 11:11:00 ip-172-31-12-99 python[92893]: raise ImproperlyConfigured( Aug 06 11:11:00 ip-172-31-12-99 python[92893]: django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJ> Aug 06 11:11:00 ip-172-31-12-99 systemd[1]: daphne.service: Main process exited, code=exited, status=1/FAILURE Aug 06 11:11:00 ip-172-31-12-99 systemd[1]: daphne.service: Failed with result 'exit-code'. Aug 06 11:11:00 ip-172-31-12-99 systemd[1]: daphne.service: Scheduled restart job, restart counter is at 1. Aug 06 11:11:00 ip-172-31-12-99 systemd[1]: Stopped WebSocket Daphne Service.
this is the error coming when i am trying to do this sudo journalctl -u daphne.service here is m asgi.py file
import os
import django
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Renter.settings')
django.setup()
from django.conf import settings
settings.configure()
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter, get_default_application
from django.core.asgi import get_asgi_application
from django.urls import path
from home.consumers import ChatConsumer, NotificationsConsumer, TenantsConsumer
application = get_asgi_application()
application = ProtocolTypeRouter(
{
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(
URLRouter(
[
path("chat/<room_code>", ChatConsumer.as_asgi()),
path("view_messages", NotificationsConsumer.as_asgi()),
path("dashboard/tenant_details/<tenant_uid>", TenantsConsumer.as_asgi())
]
)
),
}
)