[Django] #27325: Offer a solution for static file serving suitable for production use

45 views
Skip to first unread message

Django

unread,
Oct 7, 2016, 8:15:19 PM10/7/16
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
----------------------------------------+------------------------
Reporter: Tim Graham | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+------------------------
The documentation for the function for serving static files,
`django.contrib.staticfiles.views.serve()`, describes it as "grossly
inefficient and probably insecure. This is only intended for local
development, and should never be used in production." To ease the
deployment of small sites, it would be nice to fix or replace it with
something that could be used in production. [https://whitenoise.evans.io/
WhiteNoise] is an example of static file serving done in Python and is a
possible candidate for integration in Django.

Ideas are discussed in more detail on the
[https://groups.google.com/d/topic/django-
developers/N0KbgDeLuUE/discussion delegating our static file serving]
thread on django-developers.

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

Django

unread,
Oct 16, 2016, 8:07:05 AM10/16/16
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned

Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Changes (by Aleksej Manaev):

* cc: Aleksej Manaev (added)
* owner: nobody => Aleksej Manaev
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:1>

Django

unread,
Oct 31, 2016, 5:55:26 AM10/31/16
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Description changed by Mads Jensen:

Old description:

> The documentation for the function for serving static files,
> `django.contrib.staticfiles.views.serve()`, describes it as "grossly
> inefficient and probably insecure. This is only intended for local
> development, and should never be used in production." To ease the
> deployment of small sites, it would be nice to fix or replace it with
> something that could be used in production. [https://whitenoise.evans.io/
> WhiteNoise] is an example of static file serving done in Python and is a
> possible candidate for integration in Django.
>
> Ideas are discussed in more detail on the
> [https://groups.google.com/d/topic/django-
> developers/N0KbgDeLuUE/discussion delegating our static file serving]
> thread on django-developers.

New description:

The documentation for the function for serving static files,
`django.contrib.staticfiles.views.serve()`, describes it as "grossly
inefficient and probably insecure. This is only intended for local
development, and should never be used in production." To ease the
deployment of small sites, it would be nice to fix or replace it with

something that could be used in production. [http://whitenoise.evans.io/


WhiteNoise] is an example of static file serving done in Python and is a
possible candidate for integration in Django.

Ideas are discussed in more detail on the
[https://groups.google.com/d/topic/django-
developers/N0KbgDeLuUE/discussion delegating our static file serving]
thread on django-developers.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:2>

Django

unread,
Mar 24, 2017, 3:17:38 AM3/24/17
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Changes (by Aleksej Manaev):

* has_patch: 0 => 1


Comment:

Pull Request: https://github.com/django/django/pull/8245

--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:3>

Django

unread,
Mar 24, 2017, 9:45:05 AM3/24/17
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1


Comment:

I agree with what Florian said on the mailing list, "I think there is no
need to vendor [whitenoise], we can just depend on it. (like we do for
pytz)". The Django-specific parts can be moved in Django. Also, Python 2
compatibility can be removed since the master branch doesn't support it
anymore. Tests and documentation are also required.

--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:4>

Django

unread,
Mar 26, 2017, 2:43:09 PM3/26/17
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------

Comment (by Aleksej Manaev):

If we deprecate django.contrib.staticfiles.handlers.StaticFilesHandler and
replace it by DjangoWhiteNoise in
django.contrib.staticfiles.testing.StaticLiveServerTestCase it would not
be possible to run tests without using collectstaic first. Is this an
important behavior?

tests/staticfiles_tests/test_liverserver.StaticLiveServerView.test_collectstatic_emulation
only passes with DEBUG=True.

WHITENOISE_USE_FINDERS=True causes:
"django.core.exceptions.ImproperlyConfigured: WHITENOISE_USE_FINDERS can
only be enabled in development when WHITENOISE_AUTOREFRESH is also
enabled."

--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:5>

Django

unread,
Mar 31, 2017, 3:46:25 AM3/31/17
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Changes (by Aleksej Manaev):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:6>

Django

unread,
Apr 1, 2017, 7:09:04 PM4/1/17
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------------
Reporter: Tim Graham | Owner: Aleksej Manaev
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:7>

Django

unread,
Jun 2, 2022, 6:24:17 AM6/2/22
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)

Type: New feature | Status: new
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by Carlton Gibson):

* owner: Aleksej Manaev => (none)


* needs_better_patch: 1 => 0

* has_patch: 1 => 0
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:8>

Django

unread,
Mar 12, 2024, 2:42:56 AM3/12/24
to django-...@googlegroups.com
#27325: Offer a solution for static file serving suitable for production use
------------------------------+------------------------------------
Reporter: Tim Graham | Owner: (none)
Type: New feature | Status: new
Component: Core (Other) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------------+------------------------------------
Changes (by Ülgen Sarıkavak):

* cc: Ülgen Sarıkavak (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/27325#comment:9>
Reply all
Reply to author
Forward
0 new messages