First time here? Check out the FAQ!

askbot running without pictures and js

the askbot is running with uwsgi.

while the askbot run with python runserver, it is working fine.

but while it run from uwsgi, the all pictures and js lost.

seems the pictures and js location is like: <script type="text/javascript" src="/m/default/media/jslib/timeago.js?v=1"></script>.

rosettas's avatar
asked 2017-02-08 10:00:57 -0500
gopalraha's avatar
updated 2017-02-24 11:36:09 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


Configure your web server to serve static files. For example, in nginx:

location /m/ { # url should be the same as STATIC_URL in in this case it's /m/
    alias /path/to/static/files/; #path should be the same as STATIC_ROOT in
    autoindex off;
    expires 30d;
Evgeny's avatar
answered 2017-02-11 09:08:07 -0500, updated 2017-02-11 09:09:20 -0500
edit flag offensive 0 remove flag delete link


Thanks! But I am still curious why " runserver" could handle the /m/ but uwsgi could not? And what is the reason to have /m/ instead of static which is the real folder name?

rosettas's avatar rosettas (2017-02-12 14:54:13 -0500) edit

Because in production it's a lot more efficient to serve static files by a web-server such as nginx, rather than by a Python program. The `runserver` is meant only for the development and testing, so it should be serving from the media directories. The /m/ `STATIC_URL prefix can be replaced with anything else. Short url saves on bandwidth, even though a tiny bit.

Evgeny's avatar Evgeny (2017-02-12 17:08:01 -0500) edit
add a comment see more comments