login community faq

Django Admin isn't locating the required CSS files.

I've set this up correctly in the past but this time can't seem to get it right.

1
2
3
4
ADMIN_MEDIA_PREFIX = posixpath.join(STATIC_URL, "/media/")
STATIC_URL = '/site_media/'
MEDIA_URL = '/site_media/media/'
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'media')

Created symbolic link to point to: /home/user/webapps/app/lib/python2.6/django/contrib/admin/media

I'm a bit tired so I'm probably missing an obvious piece.

<link rel="stylesheet" type="text/css" href="/media/css/base.css" /> shows as not a valid link when clicked from source.

asked Jan 05 '11 at 21:07

pythondjango's gravatar image

pythondjango
1638

edited Jan 05 '11 at 22:50


Check the link to the CSS in the HTML source with your browser to make sure it is a valid link. Also login via SSH and run,

1
$ ls ~/webapps/

To verify the symbolic link is valid, it will be green if it is and red if it is not.

answered Jan 05 '11 at 21:19

johns's gravatar image

johns ♦♦
340427

Link showed as green. When I check the .css file from the html source, it is not a valid link.

(Jan 05 '11 at 22:47) pythondjango pythondjango's gravatar image

Hi,

<link rel="stylesheet" type="text/css" href="/media/css/base.css"/> Looks like it is the wrong URL to access your media. Can you try: <link rel="stylesheet" type="text/css" href="/site_media/media/css/base.css"/> or use {{ MEDIA_ROOT }}/css/base.css so that if you change the paths in the future it doesn't break your site.
(Jan 05 '11 at 22:54) klynton ♦♦ klynton's gravatar image

Klynton, Received a 404 error at that modified URL: /site_media/media/css/base.css Thanks

(Jan 05 '11 at 23:08) pythondjango pythondjango's gravatar image

Hi,

Can you submit a support ticket or provide a URL that we can see the problem happening so that we can look into it further?

(Jan 05 '11 at 23:11) klynton ♦♦ klynton'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

Asked: Jan 05 '11 at 21:07

Seen: 2,556 times

Last updated: Jan 05 '11 at 23:11

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