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?
Answers:
I am pretty sure that you are allowing the django project to run asynchronously using the asyncio module and the async keyword.
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
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?
I am pretty sure that you are allowing the django project to run asynchronously using the asyncio module and the async keyword.
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