First time here? Check out the FAQ!

Where Location of Admin Media on Nginx?


I have installed Askbot with Nginx but while I use for production site, CSS and image not loaded. I have followed instruction on and but not correct.

Whatever page is work but only when I access Django Administration is not work.

This is some information of my AskBot site:

1) Askbot forum folder = /home/mysite/forum --> Work fine

2) Location /m/ = /usr/lib/python2.6/site-packages/askbot-0.7.43-py2.6.egg/askbot/skins/ --> Work fine

3) Location /admin/media/ = /usr/lib/python2.6/site-packages/Django-1.3.1-py2.6.egg/django/contrib/admin/media/ --> Not work

4) Location /upfiles/ = /home/mysite/forum/askbot/upfiles/

Please see link image for details:

Anyone help me please?

fikri's avatar
asked 2012-06-15 01:33:33 -0500, updated 2012-06-15 01:42:01 -0500
edit flag offensive 0 remove flag close merge delete


add a comment see more comments

1 Answer


After you run command python collectstatic (it's in the manual), you'll get a directory called static, which will contain static media for all apps included into your project (as defined in the INSTALLED_APPS setting. Admin is just one of those apps.

Do re-run the collectstatic command each time you upgrade the software - that way you will rebuild contents of the static directory to match the latest version of the software.

In the webserver configuration you just need to make sure that urls to all static resources are mapped to the path to those files on the file system.

If you are using the current (at the time of this answer) template, you'll just need to map /m/ to the static directory.

For example:

    location ^~ /m/ {
            alias /srv/mysite1/static/;

That should work, assuming that your file is in /srv/mysite1/, and that you're using the default template (the media-path values inside matter).

Evgeny's avatar
answered 2012-06-15 01:45:25 -0500, updated 2012-06-15 01:51:58 -0500
edit flag offensive 0 remove flag delete link


add a comment see more comments