Opened 16 years ago

Closed 13 years ago

#6863 closed New feature (wontfix)

Allow multiple sources for files to check in autoreload

Reported by: groves Owned by: nobody
Component: Core (Management commands) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I've got a set of data files that I read when my Django app starts, after which I cache them for the rest of the run. I'd like for a change to one of those files to cause the autoreloader to do its thing. To accomplish this, I added a list of source functions to autoreload that are called in turn whenever the autoreloader runs. The functions are expected to return a sequence of files for mtime checking. The initial sources list just contains a function that does the current listing of all files in sys.modules.

This could probably use some documentation, but I don't think anything in autoreload.py itself makes sense. It seems like it'd be more appropriate somewhere user visible on the site, but I'm not sure where that would be exactly. If someone would point me to the right file, I'll happily add some documentation to the patch.

Attachments (1)

autoreload_sources.diff (1.1 KB ) - added by groves 16 years ago.

Download all attachments as: .zip

Change History (8)

by groves, 16 years ago

Attachment: autoreload_sources.diff added

comment:1 by anonymous, 16 years ago

Needs documentation: set
Triage Stage: UnreviewedDesign decision needed

comment:2 by Jeff Anderson, 16 years ago

sorry, it was me who changed the triage stage. I forgot to log in.

comment:3 by Adrian Holovaty, 16 years ago

Component: Toolsdjango-admin.py runserver

comment:4 by Gabriel Hurley, 13 years ago

Component: django-admin.py runserverCore (Management commands)

comment:5 by Julien Phalip, 13 years ago

Type: New feature

comment:6 by Julien Phalip, 13 years ago

Severity: Normal

comment:7 by Alex Gaynor, 13 years ago

Easy pickings: unset
Resolution: wontfix
Status: newclosed
UI/UX: unset

Discussion with Carl: this is a pretty uncommon problem, and this (and likely any other solution in Django) will be pretty ugly, adding more global state. Carl notes that you can fix this by putting a fake module in sys.modules, which while heinously ugly, puts it in you *your* project, and not Django.

Note: See TracTickets for help on using tickets.
Back to Top