Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'function' object has no attribute 'run' #46

Closed
phyoehtataung opened this issue Mar 12, 2022 · 2 comments
Closed

AttributeError: 'function' object has no attribute 'run' #46

phyoehtataung opened this issue Mar 12, 2022 · 2 comments

Comments

@phyoehtataung
Copy link

from website import create_app

app = create_app

if name == 'main':
app.run(debug=True)

When I run main.py, I get this error "AttributeError: 'function' object has no attribute 'run'"

@prabhosle
Copy link

I am facing same problem . have you got solution ?

@bibinthomas123
Copy link
Contributor

the create_app is a function and in the if condition it is necessary to mention __name__ == __main__

the correct code is :

from website import create_app


app = create_app()

if __name__ == '__main__' :

    app.run()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants