I am currently testing moving from Apache mod_wsgi
to Nginx and FastCGI
I have prepared the whole installation and currently testing it on a CentOS 5.4 box
that runs Django 1.1.2
In my old Apache configuration
I had and alias setup for /media/
and also one called /mediaadmin/
Which is displayed below.
Alias /media/ "/www/django_test1/omu2/media/"
<Directory "/www/django_test1/omu2/media">
Alias /mediaadmin/ "/opt/python2.6/lib/python2.6/site-packages/django/contrib/admin/media/"
<Directory "/opt/python2.6/lib/python2.6/site-packages/django/contrib/admin/media">
How do I get the same type of setup for Nginx configuration, currently here is a snippet of what I have, even after restarting Nginx i still don't see my admin side resolving with the correct CSS, images etc.
server {
location /media/ {
root /www/django_test1/omu2;
}
location /mediaadmin/ {
root /opt/python2.6/lib/python2.6/site-packages/django/contrib/admin;
}
}
My settings.py
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
BASE_URL = '127.0.0.1'
MEDIA_ROOT = "%s/media/" % BASE_PATH
MEDIA_URL = "%s/media/" % BASE_URL
ADMIN_MEDIA_PREFIX = "%s/mediaadmin/" % BASE_URL