简体   繁体   中英

openshift python app serve images

i am developing a simple python based site using wsgi.py as the only script right now. I am looking to serve a logo - a png file. Not clear where to deposit the png file and how to refer to it in the html (ie img src). thanks for pointers.

I use Django on OpenShift and set the STATIC_ROOT to

os.path.join(os.environ.get('OPENSHIFT_REPO_DIR'),'wsgi','static')

This puts all of my static files (css,images, ect.) in ~/app-root/repo/wsgi/static/

In the HTML I can refer to this directory using /static/

So to access the css: /static/style.css Or a logo: /static/logo.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM