I'm trying to run my bot and dashboard at the same time to use discord.py within the dashboard. I am using the function create_task() but it is not going, when it loads the events, commands and modules of the BOT the terminal ends.
[my code.......]
async def rundashboard():
await client.wait_until_ready()
while not client.is_closed():
os.environ['FLASK_APP'] = "dashboard.py"
os.environ['FLASK_ENV'] = "development"
os.environ['FLASK_DEBUG'] = "1"
app.run(host="0.0.0.0", port=5000)
if "__name__" == "__main__":
#client.loop.create_task(rundashboard())
client.run(settings.token)

This is indeed how blocking works. Using create_task does not magically turn synchronous code asynchronous. The general recommended way to handle something like this is either separate these two applications entirely, or use an asynchronous framework.
Note that this is not really the place to ask for help using the library, or general Python issues (as this is just a misunderstanding of how asyncio works). If you want more help with discord.py things you should join the discord server
This is not an issue with discord.py.
GitHub issues for this repository should be used to report issues with this library.
They are not a medium for requesting help with Python.
For further help specific to using this library, you should join either the official discord.py server or the Discord API server
Most helpful comment
This is indeed how blocking works. Using
create_taskdoes not magically turn synchronous code asynchronous. The general recommended way to handle something like this is either separate these two applications entirely, or use an asynchronous framework.Note that this is not really the place to ask for help using the library, or general Python issues (as this is just a misunderstanding of how asyncio works). If you want more help with discord.py things you should join the discord server