WSGI import app from python package yields 500
Question: I want to deploy my python app on apache so I made a hello world app
(contained in one python file) and imported the app object from there and it
worked. This was just to test out things.

Then I move my app file there and tried the same with it. I try to import the
app object( now from a python package), nothing blows up, however when I visit
the server I get a 500 error code. Note: the application works just fine if I
run it with python. It is not broken.

File structure:

    
    
    app.wsgi   main(this is the python package)  hello.py(this is the simple app)  
    

In app.wsgi I have this:

    
    
    import sys
    sys.path.append('/var/www/html')
    from hello import app as application
    

and that works, but when I change it to :

    
    
    import sys
    sys.path.append('/var/www/html')
    from main import app as application
    

it gives me a 500.

Any ideas as to why is this happening?


Answer: apparently I had to call run in my __init__.py file.

If anyone finds this helpful keep it otherwise take it out.

