Thanks again Karen

On Feb 6, 6:06 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Sun, Feb 6, 2011 at 12:45 PM, vanderkerkoff <tonm...@gmail.com> wrote:
> > I got it :-)
>
> > import os
> > PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
>
> > # MEDIA_ROOT = (
> > #       os.path.join(PROJECT_PATH, 'static/media/'),
> > # )
>
> > MEDIA_ROOT = '/Users/mjdavies/Sites/django/governors/static/media/'
>
> > statically pointing the media root works
>
> You rather threw out the baby with the bathwater there. The problem with
> your original setting was that you made MEDIA_ROOT a tuple, not a string.
> Just fixing it to be the right type, but still dynamically computed based on
> your project's location, would have been sufficient.
>
> > I use the same method above to grab templates, and that works ok
>
> Note TEMPLATE_DIRS is supposed to be a 
> tuple:http://docs.djangoproject.com/en/1.2/ref/settings/#template-dirs
>
> while MEDIA_ROOT is supposed to be a 
> string:http://docs.djangoproject.com/en/1.2/ref/settings/#media-root
>
> You need to adjust your method when cribbing from one setting to another and
> ensure you give each setting a value of the appropriate type.
>
> Note also this is why I suggested taking a look at (not necessarily posting
> to the list) the values of the local variables on the debug page. The code
> you were focused on (model and model admin defs) was correct, and the
> problem was elsewhere. Seeing the actual value of s that was being used
> (presumably the tuple MEDIA_ROOT had been set to) might have given you a
> clue as to where the problem was.
>
> If you have difficulty understanding all that is presented by the debug page
> and how to make use of it, there is a book linked from the page in my sig
> that may be helpful to you in improving your debugging skills.
>
> Karen
> --http://tracey.org/kmt/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to