login community faq

hi,

It seems that I can't configure django admin site to server static media (css in this case) and the admin site is shown in plain black white and blue text. I have followed these instructions

http://docs.webfaction.com/software/django/getting-started.html#serving-admin-media

(of course I changed <username> to my alias and <django_application> to my application

I named my application "admin" and created the symbolic link as instructed. I also configured settings.py like this:

1
ADMIN_MEDIA_PREFIX = '/admin/'

What am I doing wrong?

asked Feb 09 '11 at 07:07

xpanta's gravatar image

xpanta
6014


This is the way I resolved static media serve.

First I create a "Symbolic link to static-only app" and name for example "project_adminmedia" and in the extra info field I put ~/path/to/project/lib/python2.6/django/contrib/admin/media/.

Then in the site I add the app "project_adminmedia" with the url "/admin/media"

Finally in the settings.py file: ADMIN_MEDIA_PREFIX = 'http://www.siteurl/admin/media/'

Doing this I'm getting the admin media served succesfully. I hope I hasn't forget anything, and expect that my answer helps you.

Sorry for my english but I'm from Argentina.

answered Feb 09 '11 at 15:12

Luchi's gravatar image

Luchi
416

Sorry for the late response. I think I fully understand your point. So, don't worry about your English. It is fine for me. However I will need to look into it tomorrow morning as for now it is too late and I am too tired. I will report back if problem persists. Thank you very much for your input :-)

(Feb 11 '11 at 16:02) xpanta xpanta's gravatar image

Hi, I did what you said. Only there is a problem. When you say:

[[ Then in the site I add the app "project_adminmedia" with the url "/admin/media" ]]

I go to the "Home->Sites->Add" area and do this: Name:project_adminmedia, App:project_adminmedia, URL: /admin/media but then it asks me for a subdomain. What should I do then?

(Feb 12 '11 at 04:31) xpanta xpanta's gravatar image
1

You would use the same domain that your django application is on. Alternatively, you could just edit the original django application's website record and add the "project_adminmedia" app with a URL Path of "/admin/media". They're effectively the same thing.

(Feb 12 '11 at 04:38) ryans ♦♦ ryans's gravatar image

thanks. It worked! However, I couldn't use the same domain because control panel wasn't letting me to (it said that I can't use the same domain twice). So I proceeded with the 2nd way and now everything is fine. Thank you both. :-)

(Feb 12 '11 at 09:10) xpanta xpanta's gravatar image

Hi,

I add the app "project_adminmedia" with the url "/admin/media"

In the file settings.py file:

'ADMIN_MEDIA_PREFIX = '/admin/media/'

It's working now!!!!

answered Apr 04 '11 at 18:33

lcnleal's gravatar image

lcnleal
32

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:

×652
×34

Asked: Feb 09 '11 at 07:07

Seen: 1,670 times

Last updated: Apr 04 '11 at 18:33

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