__name__ not defined?

Isn’t __name__ a built-in Python variable that always is defined?

If I’m mistaken, hjow to define it?

https://replit.com/@Ahsla-AritaArit/ITeksasmens#main.py

1 Like

In line 6, to create the app variable, you use this code: app = Flask(__name). You need to replace __name with __name__.

This error is not related to __name__ == "__main__".

3 Likes

Yeah, __name__ is a built-in Python variable. However, as @KAlexK stated, you’re defining __name, not __name__, which is where the root of your problem lies.