login community 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 Apr 20 '12 at 16:36

Nick_B's gravatar image

Nick_B
94


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.

answered Apr 20 '12 at 16:54

bmeyer71's gravatar image

bmeyer71 ♦♦
8512310

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

(Apr 20 '12 at 17:12) Nick_B Nick_B's gravatar image

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.

(Apr 20 '12 at 17:25) bmeyer71 ♦♦ bmeyer71's gravatar image

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

(Apr 20 '12 at 18:06) Nick_B Nick_B's gravatar image

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.

(Apr 20 '12 at 18:18) bmeyer71 ♦♦ bmeyer71's gravatar image

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.

(Apr 20 '12 at 18:30) bmeyer71 ♦♦ bmeyer71's gravatar image

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.

answered May 06 '12 at 16:35

jkhales's gravatar image

jkhales
1

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

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