Looking for best practices advice on deploying a Flask app. My hosting provider has passenger available. I have a basic structure of:
~/home/me/dev.domain.com
└── public
└── cgi-bin
└── ...
The hosting company tells me that I need a passenger_wsgi.py at the level of the public dir.
My project roughly looks like:
.
├── app
│ ├── __init__.py
│ ├── static
│ │ ├── css
│ │ ├── images
│ │ └── js
│ ├── templates
│ │ ├── layout.html
│ │ ├── main.html
│ │ └── other.html
│ └── views
│ ├── __init__.py
│ └── main.py
└── app.py
My question is: Where should the venv live? Inside the public folder or at the same level as public
~/home/me/dev.domain.com
└── passenger_wsgi.py
└── venv
└── public
├── app
│ ├── __init__.py
│ ├── static
│ ├── templates
│ └── views
└── app.py
or
~/home/me/dev.domain.com
└── passenger_wsgi.py
└── public
├── venv
├── app
│ ├── __init__.py
│ ├── static
│ ├── templates
│ └── views
└── app.py
I have the following working:
My question was about the project layout to make deployment easier. My current solution is
Basically, I renamed the default Flask
appfolder topublic. Mypassenger_wsgi.pyscript now looks like:It looks like the contents and operation of a
passenger_wsgi.pyfile is hosting platform dependant. I had to make sure that myvenvfor the site was in my path before I did anything else. This looks nothing like the example in my provider's FAQ.