i am using django channels in my project using using official django channels v2
, my simple channels app is completed and working fine if run python manage.py runserver
but
i want to run django channels in different port so i am now using daphne
using daphne
my_project.asgi:application --port 8001
it working fine in 8001 port
INFO Starting server at tcp:port=8001:interface=127.0.0.1
INFO HTTP/2 support not enabled (install the http2 and tls Twisted extras)
and i also run python manage.py runserver
in another terminal parallely working fine. now my both channels in 8001
and django in 8000
port working correctly but my runserver command running ASGI/Channels instead of wsgi development server,
Starting ASGI/Channels version 2.2.0 development server at http://127.0.0.1:8000/
instead of
Starting development server at http://127.0.0.1:8000/
settings.py
ASGI_APPLICATION = 'my_project.routing.application'
WSGI_APPLICATION = 'my_project.wsgi.application'
if i debug any function in views.py
request, it is ASGI request instead of django wsgi request
asgi.py
import os
import django
from channels.routing import get_default_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_project.settings")
django.setup()
application = get_default_application()
my question is:
- how to get django request instead of ASGI request in our normal function view request(like
def index(request)
) or if we install django channels every request become ASGI request? - what is the use of the python mange.py runworker command