Re: staticfiles defaults broke my site
On 02.11.2010, at 03:55, Carl Karsten wrote: > I am not completely sure what is going on, but pretty sure the new > staticfiles thing is colliding with my existing > > urlpatterns += patterns('', > (r'^static/(?P.*)$', 'django.contrib.staticfiles.views.serve', >{'document_root': 'static/','show_indexes': True})) > > That used to work, now I get: > http://0.0.0.0:8080/static/ > "Page not found: /static/" (not the typical 404 error page, which > also seems like a bug, see below) > > A stupid workaround fix is: > STATICFILES_ROOT='foo' > > Here is what the docs show: > http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles > STATICFILES_ROOT Default: '' (Empty string) > STATICFILES_URL Default: '/static/' > > 404 thing: > > It does return a 404, but not the 404 page. That's mostly a backwards compatibility issue, since the static serve view (called through the old AdminMediaHandler) in 1.2.X and earlier raised a blank PermissionDenied error if accessed. I think showing here a proper 404 page isn't a bad idea though. > c...@dc10:~/temp$ curl -v http://0.0.0.0:8080/static/ > * About to connect() to 0.0.0.0 port 8080 (#0) > * Trying 0.0.0.0... connected > * Connected to 0.0.0.0 (0.0.0.0) port 8080 (#0) >> GET /static/ HTTP/1.1 >> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o >> zlib/1.2.3.4 libidn/1.18 >> Host: 0.0.0.0:8080 >> Accept: */* >> > * HTTP 1.0, assume close after body > < HTTP/1.0 404 NOT FOUND > < Date: Tue, 02 Nov 2010 02:52:58 GMT > < Server: WSGIServer/0.1 Python/2.6.6 > < Content-type: text/plain > < Content-Length: 24 > < > * Closing connection #0 > Page not found: /static/ -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: staticfiles defaults broke my site
On Nov 3, 1:47 am, Carl Karstenwrote: > On Oct 28, 9:45 pm, SmileyChris wrote: > > > My suggestion is that StaticFilesHandler only does its magic if > > 'django.contrib.staticfiles' is found in INSTALLED_APPS. Does that > > sound acceptable? > > Is it really an app? > > If not, I suggest STATICFILES_URL defaults to None, and setting it > enables the functionality. It *is* an app, in that it provides management commands when it's enabled. I'd could probably live with it defaulting to '', but I think trying to treat it as an app is a better idea (even if it does permeate through to some core code like the runserver handler). -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: staticfiles defaults broke my site
On Oct 28, 9:45 pm, SmileyChriswrote: > My suggestion is that StaticFilesHandler only does its magic if > 'django.contrib.staticfiles' is found in INSTALLED_APPS. Does that > sound acceptable? Is it really an app? If not, I suggest STATICFILES_URL defaults to None, and setting it enables the functionality. On Tue, Nov 2, 2010 at 12:31 AM, Russell Keith-Magee wrote: > On Tue, Nov 2, 2010 at 10:55 AM, Carl Karsten wrote: >> I am not completely sure what is going on, but pretty sure the new >> staticfiles thing is colliding with my existing >> >> urlpatterns += patterns('', >> (r'^static/(?P.*)$', 'django.contrib.staticfiles.views.serve', >> {'document_root': 'static/','show_indexes': True})) >> >> That used to work, now I get: >> http://0.0.0.0:8080/static/ >> "Page not found: /static/" (not the typical 404 error page, which >> also seems like a bug, see below) >> >> A stupid workaround fix is: >> STATICFILES_ROOT='foo' >> >> Here is what the docs show: >> http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles >> STATICFILES_ROOT Default: '' (Empty string) >> STATICFILES_URL Default: '/static/' >> >> 404 thing: >> >> It does return a 404, but not the 404 page. >> >> c...@dc10:~/temp$ curl -v http://0.0.0.0:8080/static/ >> * About to connect() to 0.0.0.0 port 8080 (#0) >> * Trying 0.0.0.0... connected >> * Connected to 0.0.0.0 (0.0.0.0) port 8080 (#0) >>> GET /static/ HTTP/1.1 >>> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o >>> zlib/1.2.3.4 libidn/1.18 >>> Host: 0.0.0.0:8080 >>> Accept: */* >>> >> * HTTP 1.0, assume close after body >> < HTTP/1.0 404 NOT FOUND >> < Date: Tue, 02 Nov 2010 02:52:58 GMT >> < Server: WSGIServer/0.1 Python/2.6.6 >> < Content-type: text/plain >> < Content-Length: 24 >> < >> * Closing connection #0 >> Page not found: /static/ > > Hi Carl, > > This is a known issue: > > http://code.djangoproject.com/ticket/14582 > > The ticket links to a recent django-dev discussion with a proposed fix. > > Yours, > Russ Magee %-) > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-develop...@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > -- Carl K -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
Re: staticfiles defaults broke my site
On Tue, Nov 2, 2010 at 10:55 AM, Carl Karstenwrote: > I am not completely sure what is going on, but pretty sure the new > staticfiles thing is colliding with my existing > > urlpatterns += patterns('', > (r'^static/(?P.*)$', 'django.contrib.staticfiles.views.serve', > {'document_root': 'static/','show_indexes': True})) > > That used to work, now I get: > http://0.0.0.0:8080/static/ > "Page not found: /static/" (not the typical 404 error page, which > also seems like a bug, see below) > > A stupid workaround fix is: > STATICFILES_ROOT='foo' > > Here is what the docs show: > http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles > STATICFILES_ROOT Default: '' (Empty string) > STATICFILES_URL Default: '/static/' > > 404 thing: > > It does return a 404, but not the 404 page. > > c...@dc10:~/temp$ curl -v http://0.0.0.0:8080/static/ > * About to connect() to 0.0.0.0 port 8080 (#0) > * Trying 0.0.0.0... connected > * Connected to 0.0.0.0 (0.0.0.0) port 8080 (#0) >> GET /static/ HTTP/1.1 >> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o >> zlib/1.2.3.4 libidn/1.18 >> Host: 0.0.0.0:8080 >> Accept: */* >> > * HTTP 1.0, assume close after body > < HTTP/1.0 404 NOT FOUND > < Date: Tue, 02 Nov 2010 02:52:58 GMT > < Server: WSGIServer/0.1 Python/2.6.6 > < Content-type: text/plain > < Content-Length: 24 > < > * Closing connection #0 > Page not found: /static/ Hi Carl, This is a known issue: http://code.djangoproject.com/ticket/14582 The ticket links to a recent django-dev discussion with a proposed fix. Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.
staticfiles defaults broke my site
I am not completely sure what is going on, but pretty sure the new staticfiles thing is colliding with my existing urlpatterns += patterns('', (r'^static/(?P.*)$', 'django.contrib.staticfiles.views.serve', {'document_root': 'static/','show_indexes': True})) That used to work, now I get: http://0.0.0.0:8080/static/ "Page not found: /static/" (not the typical 404 error page, which also seems like a bug, see below) A stupid workaround fix is: STATICFILES_ROOT='foo' Here is what the docs show: http://docs.djangoproject.com/en/dev/ref/contrib/staticfiles STATICFILES_ROOT Default: '' (Empty string) STATICFILES_URL Default: '/static/' 404 thing: It does return a 404, but not the 404 page. c...@dc10:~/temp$ curl -v http://0.0.0.0:8080/static/ * About to connect() to 0.0.0.0 port 8080 (#0) * Trying 0.0.0.0... connected * Connected to 0.0.0.0 (0.0.0.0) port 8080 (#0) > GET /static/ HTTP/1.1 > User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o > zlib/1.2.3.4 libidn/1.18 > Host: 0.0.0.0:8080 > Accept: */* > * HTTP 1.0, assume close after body < HTTP/1.0 404 NOT FOUND < Date: Tue, 02 Nov 2010 02:52:58 GMT < Server: WSGIServer/0.1 Python/2.6.6 < Content-type: text/plain < Content-Length: 24 < * Closing connection #0 Page not found: /static/ -- Carl K -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.