WebFaction
Community site: login faq

Hello,

I'm trying to get my site running on Django 1.6 and have everything practically set up except that the admin doesn't display the styles. My site (www.centenary.ng) is working alright and is able to retrieve the stylesheet and images but not so for the admin.

I'm serving the static file from a separate app I created using the webfaction control panel (it's called centenarystatic). Although the Django docs say that the static files can be stored in myproject/myapp/static/myapp, it didn't work for me. Instead, storing the files in the centenarystatic app works fine for the website. However, the admin styles aren't loading from there.

What could be the problem?

asked 02 Jan '14, 08:01

patxiworks
323
accept rate: 0%


I've taken a look at your account and the problem is that your templates are trying to access the media files in /static/admin/css/base.css However they are actually located one directory below the static application root. The actual path would be /static/centenarysite/admin/css/base.css You will either need to change the path in your templates or move the media files up one directory to match your current path.

permanent link

answered 02 Jan '14, 16:34

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

Thanks. Are you suggesting that I change the static url in settings.py? If I do that, wouldn't that affect the styles for the main site?

(02 Jan '14, 17:44) patxiworks

The easier method might be to move the admin directory up one level so that it is accessible with the urls that your template is already using.

(02 Jan '14, 17:48) bmeyer71 ♦♦

The admin directory? I'm not sure where that is. I don't recall creating such a directory. Could you tell me how to access it because I don't seem to be able to locate it anywhere. Thanks.

(02 Jan '14, 17:56) patxiworks

You have your application centenarystatic which contains the directory centenarysite. Below that is where the admin directory is. Try moving it up to the same level as centenarysite to see if that works.

(02 Jan '14, 18:07) bmeyer71 ♦♦

Yes it does! Thanks a lot. I was checking for the admin directory in the main site rather than in centenarystatic. Many thanks!

(02 Jan '14, 18:14) patxiworks
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
×125
×31
×2

question asked: 02 Jan '14, 08:01

question was seen: 4,882 times

last updated: 02 Jan '14, 18:14

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