[Django] #29353: Static files path cannot be the same as directory name?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #29353: Static files path cannot be the same as directory name?

Django
#29353: Static files path cannot be the same as directory name?
-------------------------------------+-------------------------------------
               Reporter:  koxu1996   |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:             |        Version:  2.0
  Uncategorized                      |       Keywords:  static-files
               Severity:  Normal     |  testing server
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I created ''functional_tests'' directory with empty ''__init__.py'' and
 ''test_all.py'' containing following code:

 {{{
 from django.test import LiveServerTestCase
 from selenium import webdriver


 class DemoTest(LiveServerTestCase):

     def test_can_get_empty_list_of_server_seeds(self):
         self.browser = webdriver.Firefox()

         print('Before page open')
         self.browser.get(self.live_server_url + '/')
         print('After page open')

         self.assertEqual(1, 1)

         self.browser.quit()
 }}}
 Running it with 'python manage.py test functional_tests/' result with
 success:

 {{{
 ...
 Before page open
 After page open
 .
 ----------------------------------------------------------------------
 Ran 1 test in 7.048s

 OK
 ...
 }}}
 But if I change LiveServerTestCase to StaticLiveServerTestCase then I am
 getting strange error:

 {{{
 $ python manage.py test functional_tests/
 Creating test database for alias 'default'...
 System check identified no issues (0 silenced).
 Before page open
 Traceback (most recent call last):
   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
     return super().__call__(environ, start_response)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
 line 146, in __call__
     response = self.get_response(request)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 62, in get_response
     return super().get_response(request)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
 line 81, in get_response
     response = self._middleware_chain(request)
 TypeError: 'NoneType' object is not callable
 Traceback (most recent call last):
   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
     return super().__call__(environ, start_response)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
 line 146, in __call__
     response = self.get_response(request)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 62, in get_response
     return super().get_response(request)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
 line 81, in get_response
     response = self._middleware_chain(request)
 TypeError: 'NoneType' object is not callable
 After page open
 .
 ----------------------------------------------------------------------
 Ran 1 test in 6.659s

 OK
 Destroying test database for alias 'default'...

 }}}

 This is my part of my settings:

 {{{
 STATIC_URL = '/static/'
 STATIC_ROOT = "/var/www/html/casino/static/"
 }}}

 It seems that url path cannot have the same name, because if I change
 STATIC_URL or STATIC_ROOT then everything works fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/29353>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/051.de01061884b667a341895e1d40e19fe2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: Static files path cannot be the same as directory name?

Django
#29353: Static files path cannot be the same as directory name?
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Uncategorized        |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  static-files         |             Triage Stage:
  testing server                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

 Can you please debug the issue and explain why Django is at fault? Or at
 least provide a sample project that reproduces the problem. I can't
 reproduce a problem given the information you provided.

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.24ab9d6b1177fc429f239e49e95ede68%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: Static files path cannot be the same as directory name?

Django
In reply to this post by Django
#29353: Static files path cannot be the same as directory name?
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Uncategorized        |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  static-files         |             Triage Stage:
  testing server                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by koxu1996):

 * Attachment "issue.tar.gz" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/29353>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.b9755c7e35a9e8bdf27a29cc31ed9622%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: Static files path cannot be the same as directory name?

Django
In reply to this post by Django
#29353: Static files path cannot be the same as directory name?
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Uncategorized        |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  static-files         |             Triage Stage:
  testing server                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by koxu1996):

 Replying to [comment:1 Tim Graham]:
 > Can you please debug the issue and explain why Django is at fault? Or at
 least provide a sample project that reproduces the problem. I can't
 reproduce a problem given the information you provided.

 I added attachment with sample project.

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.4463540090180105664a9b8eb8952cb6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler (was: Static files path cannot be the same as directory name?)

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:
  middleware_chain                   |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by koxu1996):

 * keywords:  static-files testing server => staticfiles middleware_chain
 * component:  Uncategorized => contrib.staticfiles


Old description:

> I created ''functional_tests'' directory with empty ''__init__.py'' and
> ''test_all.py'' containing following code:
>
> {{{
> from django.test import LiveServerTestCase
> from selenium import webdriver
>

> class DemoTest(LiveServerTestCase):
>
>     def test_can_get_empty_list_of_server_seeds(self):
>         self.browser = webdriver.Firefox()
>
>         print('Before page open')
>         self.browser.get(self.live_server_url + '/')
>         print('After page open')
>
>         self.assertEqual(1, 1)
>
>         self.browser.quit()
> }}}
> Running it with 'python manage.py test functional_tests/' result with
> success:
>
> {{{
> ...
> Before page open
> After page open
> .
> ----------------------------------------------------------------------
> Ran 1 test in 7.048s
>
> OK
> ...
> }}}
> But if I change LiveServerTestCase to StaticLiveServerTestCase then I am
> getting strange error:
>
> {{{
> $ python manage.py test functional_tests/
> Creating test database for alias 'default'...
> System check identified no issues (0 silenced).
> Before page open
> Traceback (most recent call last):
>   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
>     self.result = application(self.environ, self.start_response)
>   File "/usr/lib/python3.6/site-
> packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
>     return super().__call__(environ, start_response)
>   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
> line 146, in __call__
>     response = self.get_response(request)
>   File "/usr/lib/python3.6/site-
> packages/django/contrib/staticfiles/handlers.py", line 62, in
> get_response
>     return super().get_response(request)
>   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
> line 81, in get_response
>     response = self._middleware_chain(request)
> TypeError: 'NoneType' object is not callable
> Traceback (most recent call last):
>   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
>     self.result = application(self.environ, self.start_response)
>   File "/usr/lib/python3.6/site-
> packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
>     return super().__call__(environ, start_response)
>   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
> line 146, in __call__
>     response = self.get_response(request)
>   File "/usr/lib/python3.6/site-
> packages/django/contrib/staticfiles/handlers.py", line 62, in
> get_response
>     return super().get_response(request)
>   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
> line 81, in get_response
>     response = self._middleware_chain(request)
> TypeError: 'NoneType' object is not callable
> After page open
> .
> ----------------------------------------------------------------------
> Ran 1 test in 6.659s
>
> OK
> Destroying test database for alias 'default'...
>
> }}}
>
> This is my part of my settings:
>
> {{{
> STATIC_URL = '/static/'
> STATIC_ROOT = "/var/www/html/casino/static/"
> }}}
>
> It seems that url path cannot have the same name, because if I change
> STATIC_URL or STATIC_ROOT then everything works fine.
New description:

 I created ''functional_tests'' directory with empty ''__init__.py'' and
 ''test_all.py'' containing following code:

 {{{
 from django.test import LiveServerTestCase
 from selenium import webdriver


 class DemoTest(LiveServerTestCase):

     def test_can_get_empty_list_of_server_seeds(self):
         self.browser = webdriver.Firefox()

         print('Before page open')
         self.browser.get(self.live_server_url + '/')
         print('After page open')

         self.assertEqual(1, 1)

         self.browser.quit()
 }}}
 Running it with 'python manage.py test functional_tests/' result with
 success:

 {{{
 ...
 Before page open
 After page open
 .
 ----------------------------------------------------------------------
 Ran 1 test in 7.048s

 OK
 ...
 }}}
 But if I change LiveServerTestCase to StaticLiveServerTestCase then I am
 getting strange error:

 {{{
 $ python manage.py test functional_tests/
 Creating test database for alias 'default'...
 System check identified no issues (0 silenced).
 Before page open
 Traceback (most recent call last):
   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
     return super().__call__(environ, start_response)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
 line 146, in __call__
     response = self.get_response(request)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 62, in get_response
     return super().get_response(request)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
 line 81, in get_response
     response = self._middleware_chain(request)
 TypeError: 'NoneType' object is not callable
 Traceback (most recent call last):
   File "/usr/lib/python3.6/wsgiref/handlers.py", line 137, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 67, in __call__
     return super().__call__(environ, start_response)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/wsgi.py",
 line 146, in __call__
     response = self.get_response(request)
   File "/usr/lib/python3.6/site-
 packages/django/contrib/staticfiles/handlers.py", line 62, in get_response
     return super().get_response(request)
   File "/usr/lib/python3.6/site-packages/django/core/handlers/base.py",
 line 81, in get_response
     response = self._middleware_chain(request)
 TypeError: 'NoneType' object is not callable
 After page open
 .
 ----------------------------------------------------------------------
 Ran 1 test in 6.659s

 OK
 Destroying test database for alias 'default'...

 }}}

--

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.2d2fd48f583d5a7397f030f1ba815daa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:
  middleware_chain                   |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by koxu1996):

 l probably figured it out: just compare load_middleware() in BaseHandler
 and StaticFilesHandler. The former is setting _middleware_chain property,
 but second does not do anything:

 {{{
 class StaticFilesHandler(WSGIHandler):
 ...
     def load_middleware(self):
         # Middleware are already loaded for self.application; no need to
 reload
         # them for self.
         pass
 }}}
 I see two possible solutions:
 - set _middleware_chain in StaticFilesHandler.load_middleware()
 - check if _middleware_chain is not empty before calling it

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.f3083c596b42dd09f4b2f2a687c1cb5d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Accepted
  middleware_chain                   |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

 * owner:  nobody => Claude Paroz
 * status:  new => assigned
 * stage:  Unreviewed => Accepted


Comment:

 That's an issue with a 404 response when settings.DEBUG is False, it
 shouldn't fallback to `super().get_response(request)` in that case.

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.9c9bf57b97901ccd3eee3649a4a98cad%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Accepted
  middleware_chain                   |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/9901 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.0f40e3f31430716149df6b7b5da60dd3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Accepted
  middleware_chain                   |
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by koxu1996):

 Replying to [comment:6 Claude Paroz]:
 > [https://github.com/django/django/pull/9901 PR]
 It is working, so I look forward to merge.

 BTW do you know why there is 404 error? Should not be ''/static'' served
 even though STATICFILES_DIRS is not set and no files are collected?

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.20c4bc38d8ea6793aaa2fc5418951847%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Ready for
  middleware_chain                   |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.a3ff1dddec763309c53e6de10d55ebea%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  assigned
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:
     Keywords:  staticfiles          |             Triage Stage:  Ready for
  middleware_chain                   |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

 Replying to [comment:7 koxu1996]:
 > BTW do you know why there is 404 error? Should not be ''/static'' served
 even though STATICFILES_DIRS is not set and no files are collected?

 No, `StaticFilesHandler` is only serving "uncollected" files, as its
 typical use case is to serve static files during developement, not in a
 deployed environment.

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.0141d58f191168c0a590101438d4f9ef%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  staticfiles          |             Triage Stage:  Ready for
  middleware_chain                   |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz <claude@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"a9189d27efccdee0b5e8b84f69f9041176055769" a9189d27]:
 {{{
 #!CommitTicketReference repository=""
 revision="a9189d27efccdee0b5e8b84f69f9041176055769"
 Fixed #29353 -- Made StaticFilesHandler return a 404 response when
 settings.DEBUG is False
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:10>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.118be7961db09a482cedeb4909946a2f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  staticfiles          |             Triage Stage:  Ready for
  middleware_chain                   |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

 In [changeset:"1fac9740675b8dbea3952b58102a643c67e951e4" 1fac974]:
 {{{
 #!CommitTicketReference repository=""
 revision="1fac9740675b8dbea3952b58102a643c67e951e4"
 Refs #29353 -- Removed duplicated logic in
 StaticFilesHandler.get_response().

 Thanks Sergey Fursov for spotting the issue.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.4f14fe937af375e97077304442664ca7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #29353: _middleware_chain is not set for StaticFilesHandler

Django
In reply to this post by Django
#29353: _middleware_chain is not set for StaticFilesHandler
-------------------------------------+-------------------------------------
     Reporter:  koxu1996             |                    Owner:  Claude
                                     |  Paroz
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  2.0
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  staticfiles          |             Triage Stage:  Ready for
  middleware_chain                   |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

 In [changeset:"add57c7e27fa36be8ebec4df4a2cbad81e318070" add57c7e]:
 {{{
 #!CommitTicketReference repository=""
 revision="add57c7e27fa36be8ebec4df4a2cbad81e318070"
 [2.1.x] Refs #29353 -- Removed duplicated logic in
 StaticFilesHandler.get_response().

 Thanks Sergey Fursov for spotting the issue.

 Backport of 1fac9740675b8dbea3952b58102a643c67e951e4 from master
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/29353#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/066.329dbafa05bf306f44bef85d08ce69af%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.