|
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 I assume that I need to create the "media" directory inside of the admin folder, as well. Is this correct? Thank you |
|
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. 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 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. Thanks again. If my admin css is not appearing, is that a problem with my "static_media" or "admin_media" path? 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. 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. |
|
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 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. |