Ok ive made this as simple as possible, here we go :
import dash
from dash import html
if __name__ == '__main__':
print("This should print once")
app = dash.Dash(__name__)
# Define the layout of your Dash application
app.layout = html.Div(
children=[
html.H1("Hello, Dash!")
]
)
app.run_server(debug=True)
The problem is that "print("This should print once") " gets executed twice and prints twice to console when i run the program in VSCode. I'm actually completely out of ideas as to why this is happening. The bigger issue is that in my actual program this is causing two websocket objects to be created, two streams open .... Dash is literally doubling my program.
If name = 'main': is supposed to prevent things from running twice when automatically imported by Dash. Why on earth is there two main namespaces being created just by running the Dash server.