The following settings have been made in settings.py: MEDIA_ROOT = '/home/username/webapps/appmedia' My Django app now works fine: user media and static content for the site are displayed correctly. The only issue is that the admin media (CSS) is not displayed. It is looking in the following location: "http://domainname.com/static/admin/css/base.css" As I said, the rest is just fine, the only issue is with the admin media. How to fix this? edit additional, the tutorials says the following:
But it never explains how to create the admin media symbolic link. An I missing something here? asked 26 Sep '12, 06:37 Snirp |
Update, I have resolved the issue for now by adding a symlink in the folder of the static app. This points a link with the name "static" to the target $HOME/webapps/myapp/lib/python2.7/django/contrib/admin/static/admin This should not be the correct solution, but it works for now. Any suggestions still welcome. answered 26 Sep '12, 08:02 Snirp Hi, That's a correct way to accomplish this. You can also make this a symlink to static-only app, and mount it to /static/admin/ in your site configuration.
(26 Sep '12, 09:26)
todork
|
In Django 1.4 all static files of apps including admin interface files are now stored in STATIC_ROOT. To collect all static files from apps and from the Django installation into that folder, run:
This will better resolve your problem than using symlinks or functions. answered 06 Dec '12, 08:04 kent That's really only half of the solution - a more complete example is available in our documentation: Serving Django Static Media
(06 Dec '12, 11:40)
seanf
|