login community faq

The following settings have been made in settings.py:

MEDIA_ROOT = '/home/username/webapps/appmedia'
MEDIA_URL = '/media/'
STATIC_ROOT = '/home/username/webapps/appstatic'
STATIC_URL = '/static/'

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:

Creating a Website Entry The next step is to configure the WebFaction control panel to proxy requests to the Django application, static media application, and admin media symbolic link application.

But it never explains how to create the admin media symbolic link. An I missing something here?

asked Sep 26 '12 at 06:37

Snirp's gravatar image

Snirp
11

edited Sep 26 '12 at 06:45


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 Sep 26 '12 at 08:02

Snirp's gravatar image

Snirp
11

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.

(Sep 26 '12 at 09:26) todork todork's gravatar image

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:

1
manage.py collectstatic

This will better resolve your problem than using symlinks or functions.

answered Dec 06 '12 at 08:04

kent's gravatar image

kent
1

That's really only half of the solution - a more complete example is available in our documentation: Serving Django Static Media

(Dec 06 '12 at 11:40) seanf ♦♦ seanf's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×641
×34
×20

Asked: Sep 26 '12 at 06:37

Seen: 861 times

Last updated: Dec 06 '12 at 11:40

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited