Forums

Django static files DEBUG=False

[mod edit] This question is largely outdated since we released our static files support, which you'll find on the Web tab

Just curious what a good solution for serving the static files in production mode is. Something along these lines http://blog.videntity.com/?p=507 . Right now, I'm serving them through github pages and while that works I keep thinking that there has got to be a better way...Thanks.

Right now, the best way is to serve them from somewhere else like you're already doing. But we definitely appreciate that neither that nor a "set DEBUG to True and use the built-in static file stuff" is the right way for us to go in the long term, or TBH even in the short term... We've got a "Implement better static file handling" ticket on our to-do list, and I've upvoted it on your behalf.

Cool thanks. Had me really confused as I'm no Apache expert so I was beating my head against the wall trying to figure that one out.

Don't know if it's related but I've also got a weird bug with the admin files pointing to the wrong URL, ie http://kgullion.github.com/static-files/admin/img/admin/icon-yes.gif rather than http://kgullion.github.com/static-files/admin/img/icon-yes.gif

Works fine on my computer, even in DEBUG=False mode so its either a weird bug here, in Django 1.3 (have 1.4 at home) or something really dumb I've done. Could it be similar to this?

We're very tempted to blame the different Django versions ;-) - can you temporarily switch to Django 1.3 at home and see what happens?

The alternative is to do a pip install --user django==1.4, and then use some virtualenv voodoo on PythonAnywhere... I'll see if we can get a "how-to" guide written on that sometime soon...

It was the difference in versions...I've switch to 1.3 at home. Thanks for the help, you guys rock!

You're very welcome, happy coding!