swdev
swdev

Reputation: 5157

Why my Flask application can't find its static files in Openshift?

I have a flask application hosted in Opeshift here : http://bio-ekowibowo.rhcloud.com/. But as you can clearly see, it didn't have all of its required files coming from wsgi/static folder. Checking out the log using tail, I have this log :

    [Mon Oct 28 05:12:48 2013] [error] [client 127.8.243.129] File does not exist: /
var/lib/openshift/52652a99e0b8cda45f000027/app-root/runtime/repo/wsgi/static/dis
t, referer: http://bio-ekowibowo.rhcloud.com/
    [Mon Oct 28 05:12:48 2013] [error] [client 127.8.243.129] File does not exist: /
var/lib/openshift/52652a99e0b8cda45f000027/app-root/runtime/repo/wsgi/static/dis
t, referer: http://bio-ekowibowo.rhcloud.com/
    [Mon Oct 28 05:13:33 2013] [error] [client 127.8.243.129] File does not exist: /
var/lib/openshift/52652a99e0b8cda45f000027/app-root/runtime/repo/wsgi/static/dis
t, referer: http://bio-ekowibowo.rhcloud.com/
    [Mon Oct 28 05:13:34 2013] [error] [client 127.8.243.129] File does not exist: /
var/lib/openshift/52652a99e0b8cda45f000027/app-root/runtime/repo/wsgi/static/dis
t, referer: http://bio-ekowibowo.rhcloud.com/

It runs fine in my local installation. Any suggestion?

Upvotes: 0

Views: 608

Answers (2)

swdev
swdev

Reputation: 5157

Turn out, as I inspect my .gitignore file, there is an entry of dist in it. I use the provided python gitignore. I got to be really careful here. Also, I test developing this application in Windows. Well, it had a bad reputation of not having a case sensitive filename. So, the reference to avatar.png is having trouble when the only existed file is avatar.PNG

I will move back to Ubuntu tomorrow!

Upvotes: 0

niharvey
niharvey

Reputation: 2807

Try taking a look at https://www.openshift.com/blogs/build-your-app-on-openshift-using-flask-sqlalchemy-and-postgresql-92. It goes through several of the ins and outs of flask on Openshift.

Upvotes: 1

Related Questions