If I serve my admin media directly from my Django app's Apache instance, my app will run slower and use more memory. So, what's the correct way to serve my admin media on WebFaction?
19 Oct '10, 17:04
19 Oct '10, 19:06
We recommend that you use a static-only symlink application to serve your admin media - details are available in our Django documentation for serving admin media.
19 Oct '10, 17:07
I followed the docs http://docs.webfaction.com/software/django/getting-started.html#serving-admin-media , but I also needed to set an alias in httpd.conf: Alias /admin_media "/home/<user>/webapps/<app_name>/lib/python2.6/django/contrib/admin/media/"
Is that correct? It works, but I don't know why. Could you explain that to me, please?
Alias /admin_media "/home/<user>/webapps/<app_name>/lib/python2.6/django/contrib/admin/media/"
Our docs set things up so that your media is served by our front-end webserver and not by your private Apache. If you followed the docs correctly, then you don't need to set up anything in httpd.conf.
If you take out your httpd.conf changes and then restart your Apache, what kind of response do you get when you try to access /admin_media/css/base.css on your domain?
The response is: error 404.
I commented the line and restarted apache.
This is my Webfaction config:
Apps (control panel)
Symbolic link to static-only app
extra info: /home/<user_name>/webapps/<app_name>/lib/python2.6/django/contrib/admin/media
Websites (control panel)
Site apps: sc_admin_media
URL path: /media/admin
Try setting ADMIN_MEDIA_PREFIX in your settings.py to '/media/admin', then restart your Apache.
Also, check that the 'nginx' user has execute permission on your home directory.
If you want us to take a closer look at this, then please open a support ticket.
If you reply back here again, please use the 'add new comment' button below this comment, and not the "your answer" field (since you're not answering the original question).
Sorry, but I think there is a bug with comments. I can't see the "add new comment" button: http://i.min.us/ijJa9W.png (firefox 3.6.13 @ Ubuntu linux 10.04)
OK It works! I set ADMIN_MEDIA_PREFIX to '/media/admin', removed the alias in httpd.conf and restarted Apache. I also set permissions to 750 on my home.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
learn more about Markdown
question asked: 19 Oct '10, 17:04
question was seen: 4,011 times
last updated: 22 Mar '11, 11:40
Django admin: missing media
Django admin media works differently per subdomain with near-identical settings
First django setup: admin media issue
Help with Django Admin locating .css files.
Subdomains vs. URLs with Django admin
Django 1.4 Media still being handled by Apache/Django
random language changes within django admin
Serving user uploaded media
django admin media problem
Django media errors
First time here? Check out the FAQ!