I am using flask to create an application, as far as I understand, flask needs the module name to use it to find the root path of the application and find resources on the filesystem. When I pass any name to the Flask() class, it still runs without a problem, so I wonder why does it matter to pass the module name like this for instance app = Flask(__name__) while if I typed app-Flask("anything") it will still work fine?
            Asked
            
        
        
            Active
            
        
            Viewed 24 times
        
    0
            
            
         
    
    
        meral
        
- 29
- 7
1 Answers
0
            
            
        The value of what you pass into the initialization of the Flask class is used for several things, e.g. find static files and templates.
There are also other reasons, which you can look up in the following blog post: .https://blog.miguelgrinberg.com/post/why-do-we-pass-name-to-the-flask-class
 
    
    
        Jürgen Gmach
        
- 5,366
- 3
- 20
- 37
- 
                    Thank you, my question is why even if I pass nay name like this app=Flask("anything"), it still works fine with no problem? – meral May 30 '21 at 02:47