Code

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#17372 closed New feature (wontfix)

Sleep middleware

Reported by: josharian Owned by: nobody
Component: Core (Other) Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It is useful to be able to simulate slow response times from a server -- for example, to see what a mobile client ui will look like when the connection is poor.

A sleep-every-request middleware makes that very easy. The middleware is easy to write, but given how common a task it is, it might be worth having packaged with Django contrib.

To put code where my mouth is, a first cut implementation, which I happily place in the public domain, is at https://gist.github.com/1453629. I'm happy to iterate on it, given feedback.

Attachments (0)

Change History (2)

comment:1 Changed 2 years ago by carljm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

Hi, and thanks for the contribution.

Generally, the leaning has been towards making contrib smaller, not larger, and the bar for adding something is quite high - it has to be the de facto standard implementation of a very common pattern. Although this middleware could be quite useful, I don't think it meets the bar for contrib. Fortunately, there's an active ecosystem of third-party reusable Django libraries, installable with pip from the Python Package Index, and I think this would fit right in to that larger ecosystem. I'd encourage you to package it up, put it on PyPI, and see if it gains some traction.

Thanks again!

comment:2 Changed 2 years ago by aaugustin

http://djangosnippets.org/ is also a good place to upload such utilities.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.