-1

I have the following simple py file below. It works fine if I type python damn.py, but it says not to use it as production server. I have installed waitress. In my case, what exactly should the argument in the " " be? I have tried waitress-serve --call "damn:create_app", but it id not work.

damn.py

from flask import Flask

api = Flask(__name__)

@api.route('/test', methods=['GET'])
def test():
  return "Hello world"

if __name__ == '__main__':
    api.run()
David K. Hess
  • 16,632
  • 2
  • 49
  • 73
Damn Vegetables
  • 11,484
  • 13
  • 80
  • 135

1 Answers1

0
waitress-serve --help

lists the following on the --call flag:

Call the given object to get the WSGI application.

You have no create_app function that returns the WSGI application. You don't need the call flag since you're not using the Application Factory pattern.

You can just do:

waitress-serve "damn:api"
5eb
  • 14,798
  • 5
  • 21
  • 65