How to install falcon python framework in window and what command requires need to run its app?

I was trying to install falcon in windows .Falcon is installed successfully but when i try run its program
it is not working

import falcon
 
# Create a Falcon application
app = falcon.App()
 
# Define a resource to handle requests
class HelloWorldResource:
    def on_get(self, req, resp):
        resp.status = falcon.HTTP_200
        resp.body = "Hello, WSGI World!"
 
# Add the resource to the application
app.add_route("/", HelloWorldResource())

I have used this command to run
run commmand: waitress-serve --host=0.0.0.0 --port=8000 app:app

Error is
There was an exception (ModuleNotFoundError) importing your module.

It had these arguments:

  1. No module named 'app'

Actually I was trying to run simple app of falcon and print “Hello world”

  • What’s your python file name? If your Python file is named main.py, it should be like waitress-serve --host=0.0.0.0 --port=8000 main:app.

    – 

Leave a Comment