Ask Your Question

Where Location of Admin Media on Nginx?

asked 2012-06-15 01:33:33 -0500

fikri's avatar

updated 2012-06-15 01:42:01 -0500


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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-06-15 01:45:25 -0500

Evgeny's avatar

updated 2012-06-15 01:51:58 -0500

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).

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-06-15 01:33:33 -0500

Seen: 433 times

Last updated: Jun 15 '12