Reputation: 182
I'm new to flask. I want to deploy my flask application on prod, so for that I want to use Twisted web server (on windows).
Below is my proj structure and I'm using Blueprints:
my run.py file is as below:
#!/usr/bin/env python
from ProjName import app
if __name__ == '__main__':
app.run()
command I'm trying is :
twistd web --wsgi run.app
In top most init.py I'm just doing :
app = Flask(__name__)
And rest code is related to registering blueprints.
What changes do I need to make in my files so as to run on twisted web? Or do I need to completely restructure my code?
PS: I know my question may not be clear. I've referred some links but it is just confusing me. Appreciate your help!
Upvotes: 5
Views: 2109
Reputation: 48335
You haven't put the root of your source tree into Python's import path so the module name "run" can't be resolved. Fix it by setting PYTHONPATH (for example):
export PYTHONPATH=${PYTHONPATH}:${PWD}
twistd web --wsgi run.app
Upvotes: 5