django - How to Python Code on Interpreter Startup in Virtualenv? -


i want execute code after python interpreter has started.

we use virtualenv , had file called sitecustomize.py got executed during interpreter start up.

the sitecustomize.py part of our project. use django definition of term: small python module holds config , no code: django's definition of "project"

unfortunately linux distros (ubuntu) provide global sitecustomize, , our per virtualenv sitecustomize not loaded.

question

how run python code on interpreter startup in virtualenv?

this code should executed if interactive interpreter gets started.

goal vs strategy

i don't care if hook called "sitecustomize" or different :-)

use usercustomize.

on linux distros global sitecustomize exists, on not.

this can lead confusing behaviour.

no linux distro provides usercustomize.

see site

... after this, attempt made import module named usercustomize, can perform arbitrary user-specific customizations, if enable_user_site true.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -