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

Could you please clarify this deprecation warning?! #915

Open
exoosh opened this issue Dec 16, 2022 · 2 comments
Open

Could you please clarify this deprecation warning?! #915

exoosh opened this issue Dec 16, 2022 · 2 comments

Comments

@exoosh
Copy link

exoosh commented Dec 16, 2022

.local/lib/python3.9/site-packages/hug/api.py:500: DeprecatedWarning: Call to deprecated function __init__(...). API >
  module.__hug_wsgi__ = module.__hug__.http.server()

I was starting the app with Gunicorn and the wsgi_app for Gunicorn was set to app:__hug_wsgi__.

I should mention that I do have the following in my .py file such that I can start it standalone:

if __name__ == "__main__":
    hug.API(__name__).http.serve()

Thanks.

@Sahithiaele
Copy link

The warning you're seeing is likely due to the use of a deprecated method in Hug.
The __hug_wsgi__ attribute is deprecated, and you should use hug.API(http=hug.http.SERVEME) instead.

@exoosh
Copy link
Author

exoosh commented Feb 16, 2024

Thank you, @Sahithiaele !

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

2 participants