Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/django/utils/autoreload.py
Commit message (Collapse)AuthorAgeFilesLines
* Made the autoreloader survive all exceptions.Aymeric Augustin2015-08-291-2/+1
| | | | Refs #24704.
* Fixed #24704 -- Made the autoreloader survive SyntaxErrors.Aymeric Augustin2015-08-291-1/+12
| | | | | | | | | | | | | | | | | With this change, it's expected to survive anything except errors that make it impossible to import the settings. It's too complex to fallback to a sensible behavior with a broken settings module. Harcoding things about runserver in ManagementUtility.execute is atrocious but it's the only way out of the chicken'n'egg problem: the current implementation of the autoreloader primarily watches imported Python modules -- and then a few other things that were bolted on top of this design -- but we want it to kick in even if the project contains import-time errors and django.setup() fails. At some point we should throw away this code and replace it by an off-the-shelf autoreloader that watches the working directory and re-runs `django-admin runserver` whenever something changes.
* Ensured gen_filenames() yields native strings.Aymeric Augustin2015-08-291-1/+2
| | | | | This also fixes a test failure on Python 2 when Django is installed in a non-ASCII path. This problem cannot happen on Python 3.
* Accounted for error files in the autoreloader.Aymeric Augustin2015-08-291-2/+2
| | | | | | | * When some old files contain errors, the second call to gen_filenames() should return them. * When some new files contain errors, the first call to gen_filenames(only_new=True) should return them.
* Refs #23882 -- Added detection for moved files when ↵Chris Bainbridge2015-07-071-1/+3
| | | | | | | | | | | | using inotify polling Commit 15f82c7 ("used pyinotify as change detection system when available") introduced a regression where editing a file in vim with default settings (writebackup=auto) no longer causes the dev server to be restarted. On a write, vim moves the monitored file to a backup path and then creates a new file in the original. The new file is not monitored as it has a different inode. Fixed this by also watching for inotify events IN_DELETE_SELF and IN_MOVE_SELF.
* Removed some obsolete absolute_imports.Tim Graham2015-02-091-3/+0
|
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-1/+2
|
* Removed threading fallback imports.Tim Graham2015-01-281-4/+1
| | | | Django imports threading in many other places without fallback.
* Fixed #23083 -- Fixed runserver reloading when deleting ↵Tim Graham2014-07-251-0/+1
| | | | | | a file. Thanks Collin Anderson for the report and hirokiky for the fix.
* Fixed #22991 -- Prevented *.pyc files in autoreload ↵Claude Paroz2014-07-151-6/+10
| | | | | | | | monitoring This fixes a regression introduced in 6d302f639. Thanks lorinkoz at gmail.com for the report, Collin Anderson for the initial patch and Simon Charette for the review.
* Fixed flake8 errors.Tim Graham2014-07-081-0/+1
|
* Fixed pyinotify performance regression in 15f82c7011Claude Paroz2014-07-061-11/+34
| | | | Refs #9722. Thanks Tim Graham for the review.
* Added newline to fix flake8 error.Tim Graham2014-06-261-0/+1
|
* Fixed #22857 -- Reset translations when only .mo file ↵Claude Paroz2014-06-261-4/+29
| | | | | | | | changed No need to restart the server when a translation file changes. Refs #9523. Thanks artscoop for the report and Tim Graham for the review.
* Added an explanatory comment. Refs #22017Alex Gaynor2014-04-021-0/+3
|
* Revert "Merge pull request #2508 from tomwys/patch-1"Alex Gaynor2014-04-021-1/+1
| | | | | This reverts commit c45607e9395ffd05c2cff454fdb55b3ab05dc0e3, reversing changes made to 9769337ca855f4831c855d6663ff3f688ee1652d.
* Don't copy list for iteration.Tomasz Wysocki2014-04-021-1/+1
|
* Fixed #22017 -- Prevented RuntimeError on Python 3Claude Paroz2014-02-121-1/+1
| | | | Refs #21049. Thanks quinox for the report.
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-2/+2
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Stopped iterating on INSTALLED_APPS.Aymeric Augustin2013-12-221-6/+3
| | | | Used the app cache's get_app_configs() method instead.
* Fixed #21621 -- Removed kqueue autoreloader.Aymeric Augustin2013-12-151-100/+0
|
* Fixed #21546 -- Strengthened kqueue detection.Aymeric Augustin2013-12-041-1/+1
| | | | Thanks Loic Bistuer.
* Fixed #21545 -- autoreload kqueue events weren't cleared ↵Loic Bistuer2013-12-021-1/+1
| | | | which caused an infinite loop.
* Fixed #21500 -- Removed imports of deprecated ↵Baptiste Mispelon2013-11-241-1/+3
| | | | utils.importlib
* Flake8 fixes -- including not runnign flake8 over a ↵Alex Gaynor2013-11-111-1/+0
| | | | backported file
* Fixed #21420 once more.Aymeric Augustin2013-11-111-1/+1
|
* Fixed #9523 -- Restart runserver after compiling apps ↵Bouke Haarsma2013-11-111-13/+21
| | | | | | | translations Django also uses locales provided by apps, which also might change. Also when i18n is disabled, there is no need for watching translation files.
* Fixed #21420 -- Autoreloader on BSD with Python 3.Aymeric Augustin2013-11-111-1/+3
| | | | Thanks Bouke Haarsma for the report.
* Flake8 fixesAlex Gaynor2013-11-051-1/+0
|
* Updated the set of watched files after each request.Aymeric Augustin2013-11-041-33/+72
| | | | | | | | Otherwise the kqueue-based autoreloader may not see changes to files that weren't imported when the server started. Thanks Bouke Haarsma for the report and Loïc Bistuer for locating the problem.
* Correct flake8 E302 violationsRay Ashman Jr2013-11-031-0/+8
|
* More attacking E302 violatorsAlex Gaynor2013-11-021-0/+1
|
* Merge pull request #1848 from rayashmanjr/masterAlex Gaynor2013-11-021-1/+1
|\ | | | | Correct flake8 violation E261
| * Correct flake8 violation E261Ray Ashman Jr2013-11-021-1/+1
| |
* | Fixed #21302 -- Fixed unused imports and import *.Tim Graham2013-11-021-1/+1
|/
* Fixed #9523 -- Restart runserver after translation MO ↵Bouke Haarsma2013-11-021-3/+18
| | | | | | files change Thanks to Krzysztof Kulewski for the initial patch.
* Improved resource limits handling in the kqueue ↵Aymeric Augustin2013-11-011-4/+27
| | | | | | autoreloader. Refs #21356. Thanks Loïc.
* Reduce the set of events that trigger a reload.Aymeric Augustin2013-10-311-9/+1
| | | | This seems to avoid multiple reloads.
* Add instant autoreload on platforms supporting kqueue.Aymeric Augustin2013-10-301-0/+45
|
* Fixed #9722 - used pyinotify as change detection system ↵Unai Zalakain2013-10-301-11/+63
| | | | | | | | | when available Used pyinotify (when available) to replace the "pool-every-one-second" mechanism in `django.utils.autoreload`. Thanks Chris Lamb and Pascal Hartig for work on the patch.
* Fixed assorted flake8 errors.Tim Graham2013-10-111-1/+5
|
* Whitespace cleanup.Tim Graham2013-10-101-1/+0
| | | | | | | * Removed trailing whitespace. * Added newline to EOF if missing. * Removed blank lines at EOF. * Removed some stray tabs.
* Fixed #21049 -- Fixed autoreload for Python 3Max Burstein2013-09-061-1/+1
| | | | | | Changed th system module values check to return a list. In Python 3 it returns a dict_view which could occassionally produce a runtime error of "dictionary changed size during iteration".
* Made dev server autoreloader ignore filenames reported ↵Thomas Bartelmess2013-01-111-0/+2
| | | | | | | | as None. Useful under Jython. Thanks Thomas Bartelmess for the report and patch. Ref #9589.
* Fixed #19485 -- Python 3 compatibility for c2a6b2a4.Aymeric Augustin2012-12-171-2/+7
| | | | Refs #9589.
* Fixed #9589 -- Made development web server more robust ↵Ramiro Morales2012-12-151-3/+32
| | | | | | in the presence of a wider variety of code errors. Thanks goes to contributor with Trac user 'berto' for the patch.
* [py3] Added compatibility import of thread/_threadAymeric Augustin2012-08-181-1/+1
| | | | | | This commit fixes the auto-reload of the development server. I should have done that change in ca07fda2.
* [py3] Replace filter/lambda by list comprehensionsAymeric Augustin2012-08-141-1/+2
| | | | | This is more idiomatic and avoids returning a list on Python 2 and an iterator on Python 3.
* [py3] Switched to Python 3-compatible imports.Aymeric Augustin2012-07-221-1/+1
| | | | | xrange/range will be dealt with in a separate commit due to the huge number of changes.