WebFaction
Community site: login 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 26 Sep '12, 06:37

Snirp
226
accept rate: 50%

edited 26 Sep '12, 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.

permanent link

answered 26 Sep '12, 08:02

Snirp
226
accept rate: 50%

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.

(26 Sep '12, 09:26) todork

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:

manage.py collectstatic

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

permanent link

answered 06 Dec '12, 08:04

kent
111
accept rate: 0%

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

(06 Dec '12, 11:40) seanf
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:

×908
×40
×26

question asked: 26 Sep '12, 06:37

question was seen: 5,040 times

last updated: 06 Dec '12, 11:40

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