I have searched the list and haven't found anything that directly
addresses this.  Forgive me if it is redundant.

The first question I have regards where to put media such as the .css
files and related images which will define the style of my site.  In
the settings file, there are two locations which seem like reasonable
fits: MEDIA_ROOT and ADMIN_MEDIA_PREFIX.  After reading through the
documentation, FAQs and this list, I came to the conclusion that
MEDIA_ROOT is probably the more appropriate location for this type of
file.  Is this a correct assumption?  Given that this is probably a
common scenario (newbies wondering: where do I put my stylesheets?)
should this be stated explicitly somewhere in the docs/tutorial/FAQ?

Second, there is no clear method documented for graceful access to the
MEDIA_ROOT inside of my application's templates.  My problems arise
because of differences between my development and production
environments.  For example, let's say that I'm serving media files
from the following location on my development machine:

http://127.0.0.1/media/

But on my production machine, it is served from here:

http://media.myserver.com/

Changing a single config setting (MEDIA_ROOT) when I deploy seems
reasonable to me.  But changing my templates every time I deploy
doesn't seem reasonable.  So instead of doing something like this in
my index.html template:

<html>
  <head>
    ...
    <link href="http://127.0.0.1/media/style.css"; rel="stylesheet"
type="text/css" title="Style" />
    ...
  </head>
  ...
</html>

I'd like to do something like this:

<html>
  <head>
    ...
    <link href="{{ MEDIA_ROOT }}/style.css" rel="stylesheet"
type="text/css" title="Style" />
    ...
  </head>
  ...
</html>


Though I've searched high and low, I can't seem to find documentation
that tells me how to do something like this.  And like the above
scenario, I can see a lot of newbies wanting to know how to do the
same thing.  Should this be added to the docs/tutorial/FAQ as well?

Thanks in advance!

Taft


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to