WebFaction
Community site: login faq
0
1

Hi I am following the "Getting Started on Django" webcast and am confused about how to set the absolute path to symlink when creating the "admin_media" application.

Do I use:

home/webapps/(app name)/lib/python2.7/django/contrib/admin/media
(my username)/webapps/(app name)/lib/python2.7/django/contrib/admin/media
(my username)/~/webapps/(app name)/lib/python2.7/django/contrib/admin/media

I assume that I need to create the "media" directory inside of the admin folder, as well. Is this correct?

Thank you

asked 20 Apr '12, 16:36

Nick_B
111014
accept rate: 0%


You would specify the full path starting with /home

If you are using Django 1.4, you just need to point to your static media files where they get collected. We have some documentation here to help with this.

permanent link

answered 20 Apr '12, 16:54

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

To clarify: I am confused by the "~" sign that is listed as the name of my username directory when navigating through terminal.

So is the path "home/(my username)/webapps/(app name)/lib/python2.7/django/contrib/admin/media"?

Or would it be "home/~/webapps/(app name)/lib/python2.7/django/contrib/admin/media"?

Thank you very much for your support @bmeyer71

(20 Apr '12, 17:12) Nick_B

You would use /home/<username>/webapps/<appname>/lib/python2.7... in that case.

The ~ is a shortcut, using your username, to your home directory. But when specifying the absolute path it is better to spell it out as I described.

(20 Apr '12, 17:25) bmeyer71 ♦♦

Thanks again. If my admin css is not appearing, is that a problem with my "static_media" or "admin_media" path?

(20 Apr '12, 18:06) Nick_B

Well, with Django 1.4, there is no longer an admin media prefix so it gets it's media from the same place you have your static_media setup.

Please have a look at our docs http://docs.webfaction.com/software/django/config.html?highlight=django%20media#serving-django-static-media which should help explain that a bit more for you.

(20 Apr '12, 18:18) bmeyer71 ♦♦

Some of the instructions are still valid, but the way Django handles the media files has changed since the video. The instructions in the video have not been updated for Django 1.4 yet, the online documentation has been.

(20 Apr '12, 18:30) bmeyer71 ♦♦

I just finished dealing with this problem. It's not so bad in retrospect.

View the source on your admin login page. It probably says it is looking for the css files in /static/admin/

The problem is that there isn't anything there necessarily. All the data you want is actually stored in /home/<username>/webapps/<appname>/lib/python2.7.../admin/static/admin/

(in contrast to 1.3 /home/<username>/webapps/<appname>/lib/python2.7.../admin/media/ )

Using a symbloic link you can get send the browser to
/home/<username>/webapps/<appname>/lib/python2.7.../admin/static
when it queries /static/admin

Explicitly: make a symbolic link app. put /home/<username>/webapps/<appname>/lib/python2.7.../admin/static in the extra info. Add the app to your website with the url /static/admin. restart apache.

permanent link

answered 06 May '12, 16:35

jkhales
1
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
×113
×33
×30

question asked: 20 Apr '12, 16:36

question was seen: 4,206 times

last updated: 06 May '12, 16:35

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