Re: Media variables confusion

2008-06-18 Thread scorpioxy


On Jun 17, 11:59 pm, Joel Bernstein <[EMAIL PROTECTED]> wrote:
> Generally, Django could not care less where you put most of your
> static media files. There are two main exceptions, though:
>
> 1. Django needs to know the URL to the media files for its admin
> application (ADMIN_MEDIA_PREFIX)
> 2. Django needs to know where in the server's filesystem it should put
> newly uploaded files (MEDIA_ROOT) and what URL they'll show up at
> afterward (MEDIA_URL).
>
> If you don't use the admin application, you can safely ignore
> ADMIN_MEDIA_PREFIX. If none of your applications' models include any
> file-upload fields, you can safely ignore MEDIA_ROOT and MEDIA_URL.
>

Ah thanks. This explains it well. I think my confusion was due to this
statement describing MEDIA_ROOT in the docs "Absolute path to the
directory that holds media for this installation."

As you can see, there was no mention of user files or anything like
that. But simply, media for this installation.

Thank you all for your help.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Media variables confusion

2008-06-17 Thread Joel Bernstein

Generally, Django could not care less where you put most of your
static media files. There are two main exceptions, though:

1. Django needs to know the URL to the media files for its admin
application (ADMIN_MEDIA_PREFIX)
2. Django needs to know where in the server's filesystem it should put
newly uploaded files (MEDIA_ROOT) and what URL they'll show up at
afterward (MEDIA_URL).

If you don't use the admin application, you can safely ignore
ADMIN_MEDIA_PREFIX. If none of your applications' models include any
file-upload fields, you can safely ignore MEDIA_ROOT and MEDIA_URL.

On Jun 17, 2:27 pm, "Alaa Salman" <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> So i am a little confused by the MEDIA_ROOT, MEDIA_URL, and
> ADMIN_MEDIA_PREFIX  variables.
>
> I understand that the ADMIN_MEDIA_PREFIX provides the prefix. But so what if
> it was on another url? I am assuming that the common use case is to serve
> them from the same domain, which is what i am doing. But just in case...
>
> Also, why do we need a MEDIA_ROOT as a path to a directory if we can use the
> static.serve view during development? And then so why are both the MEDIA_URL
> and MEDIA_ROOT needed?
>
> As you can see, I'm a little confused by these settings and have managed to
> develop with using them this far. So any explanation is appreciated. I find
> the documentation a little lacking in explaining these vars.
>
> Regards,
> Alaa Salmanhttp://www.codedemigod.com
> FSF Member #6304
> "Never measure the height of a mountain until you have reached the top. Then
> you will see how low it was." ---Dag Hammarskjold
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Media variables confusion

2008-06-17 Thread Bartek Gniado
You need MEDIA_ROOT because yes, you serve it from static.serve view during
development but when you launch you do not want to be using the devserver to
display your site. MEDIA_URL is essentially the same url you map through
Apache, lighthttpd, whatever you use

But you are right, you can use the dev server to setup where your media is
but once you go onto a more public launch viewing you will want to switch
using Apache / mod_python combo or something else.

This describes it pretty well:
http://www.djangoproject.com/documentation/modpython/#serving-media-files

On Tue, Jun 17, 2008 at 3:27 PM, Alaa Salman <[EMAIL PROTECTED]> wrote:

> Hey guys,
>
> So i am a little confused by the MEDIA_ROOT, MEDIA_URL, and
> ADMIN_MEDIA_PREFIX  variables.
>
> I understand that the ADMIN_MEDIA_PREFIX provides the prefix. But so what
> if it was on another url? I am assuming that the common use case is to serve
> them from the same domain, which is what i am doing. But just in case...
>
> Also, why do we need a MEDIA_ROOT as a path to a directory if we can use
> the static.serve view during development? And then so why are both the
> MEDIA_URL and MEDIA_ROOT needed?
>
> As you can see, I'm a little confused by these settings and have managed to
> develop with using them this far. So any explanation is appreciated. I find
> the documentation a little lacking in explaining these vars.
>
>
> Regards,
> Alaa Salman
> http://www.codedemigod.com
> FSF Member #6304
> "Never measure the height of a mountain until you have reached the top.
> Then you will see how low it was." ---Dag Hammarskjold
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Media variables confusion

2008-06-17 Thread Alaa Salman
Hey guys,

So i am a little confused by the MEDIA_ROOT, MEDIA_URL, and
ADMIN_MEDIA_PREFIX  variables.

I understand that the ADMIN_MEDIA_PREFIX provides the prefix. But so what if
it was on another url? I am assuming that the common use case is to serve
them from the same domain, which is what i am doing. But just in case...

Also, why do we need a MEDIA_ROOT as a path to a directory if we can use the
static.serve view during development? And then so why are both the MEDIA_URL
and MEDIA_ROOT needed?

As you can see, I'm a little confused by these settings and have managed to
develop with using them this far. So any explanation is appreciated. I find
the documentation a little lacking in explaining these vars.


Regards,
Alaa Salman
http://www.codedemigod.com
FSF Member #6304
"Never measure the height of a mountain until you have reached the top. Then
you will see how low it was." ---Dag Hammarskjold

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---