First time here? Check out the FAQ!
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?
Oct 19 '10 at 17:04
Oct 19 '10 at 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.
Oct 19 '10 at 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
Asked: Oct 19 '10 at 17:04
Seen: 2,429 times
Last updated: Mar 22 '11 at 11:40
This is the Q&A forum for the WebFaction community. Login or sign up today!
WebFaction - Smarter web hosting
Django admin: missing media
Django admin media works differently per subdomain with near-identical settings
First django setup: admin media issue
random language changes within django admin
django and static media
django admin media problem
Django admin not available from www.mydomain.com/admin
Django 1.3 setup documentation
Custom Django form image upload and django avatar
TypeError: unsupported operand type(s) for -: 'str' and 'str'
Plans & prices
Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited