hug icon indicating copy to clipboard operation
hug copied to clipboard

Could you please clarify this deprecation warning?!

Open exoosh opened this issue 3 years ago • 2 comments

.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.

exoosh avatar Dec 16 '22 10:12 exoosh

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.

Sahithiaele avatar Feb 16 '24 16:02 Sahithiaele

Thank you, @Sahithiaele !

exoosh avatar Feb 16 '24 16:02 exoosh