python - Performance of wsgi file important? -


i've built website using (awesome) python flask framework, i'm deploying on aws. create wsgi file looks this:

import sys sys.path.insert(0, '/var/www/myawesomewebsite') app import app application 

since try avoid hardcoding strings code changed following:

import sys, os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) app import app application 

what wonder whether performance of wsgi file matters (with respect additional overhead of os.path.dirname(os.path.abspath(__file__))).

is wsgi file parsed , executed every web-request, or loaded once when apache started? tips welcome!

the wsgi file executed when application server loads app.

using apache, happen once in while when apache recycles worker thread / process. same goes other application servers (e.g. gunicorn run wsgi file once per worker).

you're fine.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -