0

I am trying to create a websocket app with django, But since i updated to django 4.1 when i am generating a new project with django-admin startproject 'name' , it does not generate an asgi.py file.

And when I'm trying to create one, and configure it :

it says: Import "django.core.asgi" could not be resolved from source

settings.py:



ASGI_APPLICATION = 'testbot.asgi.application'


asgi.py:


import os

from django.conf.urls import url
from django.core.asgi import get_asgi_application


os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testbot.settings')
django_asgi_app = get_asgi_application()


0 Answers0