WebFaction
Community site: login 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:

ADMIN_MEDIA_PREFIX = '/admin/'

What am I doing wrong?

asked 09 Feb '11, 07:07

xpanta
622844
accept rate: 0%


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.

permanent link

answered 09 Feb '11, 15:12

Luchi
4147
accept rate: 20%

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 :-)

(11 Feb '11, 16:02) xpanta

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?

(12 Feb '11, 04:31) xpanta
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.

(12 Feb '11, 04:38) ryans ♦♦

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. :-)

(12 Feb '11, 09:10) xpanta

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!!!!

permanent link

answered 04 Apr '11, 18:33

lcnleal
324
accept rate: 0%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×40

question asked: 09 Feb '11, 07:07

question was seen: 4,513 times

last updated: 04 Apr '11, 18:33

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM