what is happening on os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = "true"

Question:

I am creating a bot using botframework within a django application.
At first, I was not able to call the models of that application from the bot. I found a solution, which was to put os.environ["DJANGO_ALLOW_ASYNC_UNSAFE"] = True in the settings.py file.

It works fine for me.

But I am curious to know, what is happening when I do this. Is it safe?

Asked By: richu sherseen

||

Answers:

I am pretty sure that you are allowing the django project to run asynchronously using the asyncio module and the async keyword.

Answered By: Ed May

setting DJANGO_ALLOW_ASYNC_UNSAFE to true is not a recommended way.it may cause data loss .so I change the function as an API end-point and call it,instad of calling the function. its works for me

Answered By: richu sherseen