On Jan 26, 1:46 am, Jonas Geiregat <jo...@geiregat.org> wrote:
> Op 26-jan-2011, om 06:46 heeft Brian Neal het volgende geschreven:
>
> > Hi -
> > I'm trying to cut over my project to use the new staticfiles
> > application. I'm using the dev server with DEBUG = True on a recent
> > SVN trunk checkout. My STATIC_URL is '/static/' and my MEDIA_URL is
> > 'http://localhost:8000/media/'in this environment.
>
> STATIC_URL and MEDIA_URL are two different things.

Agree.

>
> if you want to serve static files that are related to your 
> webdesign/development you should use STATIC.
> User related files such as uploaded files such be placed inside the MEDIA 
> path.

That is what I'm trying to do.

>
> so change STATIC_URL into MEDIA_ROOT='static/'.

I don't understand this. One is a URL, the other is a file path. Why
would I set STATIC_URL = MEDIA_ROOT? Or did you make a typo and mean
MEDIA_URL? That might make more sense to me.

My question is, if I want to serve my apps' static files at the URL /
static/ and user-uploaded media at /media/ (Is this an unusual
requirement? Maybe this is typically only done in production?) what is
the best way to do this with the dev server, and should the docs be
strengthened to support this? The dev server, with DEBUG=True, does a
good job of serving my apps' static files at the URL rooted at /
static/, but it (obviously) 404's when a request is made for /media/.
So here I think I need to configure the new static serving view with
the URL pattern /media/ (and point it at my MEDIA_ROOT as I showed in
my original post).

Or, do most people (in dev. mode) set MEDIA_URL = STATIC_URL, and then
add the MEDIA_ROOT path to the STATICFILES_DIRS setting? Or do
something else?

Could some people could post their full (STATIC|MEDIA)_(ROOT|URL) and
STATICFILES_* settings for their dev server environment? I guess I am
looking for some "best practice" examples; for some reason this is
really tripping me up. Thank you.

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