contrib.staticfiles and runserver

7 views
Skip to first unread message

SmileyChris

unread,
Oct 28, 2010, 9:45:15 PM10/28/10
to Django developers
It's cool that runserver takes away the hassle of needing to add in
your static url (is this documented? I didn't find it in my skim) but
doing it by default seems pretty backwards incompatible, even if we
are just talking about the dev server.

My suggestion is that StaticFilesHandler only does its magic if
'django.contrib.staticfiles' is found in INSTALLED_APPS. Does that
sound acceptable?

SmileyChris

unread,
Oct 28, 2010, 9:51:34 PM10/28/10
to Django developers
On Oct 29, 2:45 pm, SmileyChris <smileych...@gmail.com> wrote:
> doing it by default seems pretty backwards incompatible, even if we

I was a bit terse, let me expand.
STATICFILES_URL defaults to '/static/'. The StaticFilesHandler (which
is now what is used by runserver) swallows requests to this url.

Yeah, that's about it. Easy to solve for my case (since I was just
using django-staticfiles anyway, I just needed to set
STATICFILES_DIRS) but still was a few minutes of head-scratching as to
what was going wrong.

Russell Keith-Magee

unread,
Oct 28, 2010, 9:53:22 PM10/28/10
to django-d...@googlegroups.com

A related ticket: http://code.djangoproject.com/ticket/14582

Yours,
Russ Magee %-)

Carl Meyer

unread,
Oct 28, 2010, 11:34:31 PM10/28/10
to Django developers
On Oct 28, 9:45 pm, SmileyChris <smileych...@gmail.com> wrote:
> My suggestion is that StaticFilesHandler only does its magic if
> 'django.contrib.staticfiles' is found in INSTALLED_APPS. Does that
> sound acceptable?

That seems like a very reasonable opt-in approach that solves the
backwards-compatibility problem. +1

Carl
Reply all
Reply to author
Forward
0 new messages