Go to file
Daniel Tao 6f7279c4b1 Refs #28593 -- Made URLResolver._populate() more resilient to signal interrupts.
_populate() sets the populating attribute to prevent infinite recursion in
case a urlconf includes itself. The flag is a threadlocal to avoid a race
condition [1] where one thread sets the flag and another checks it, then
proceeds to access data that's supposed to be populated (e.g. _reverse_dict)
but isn't yet.

The potential still exists for a thread to set the threadlocal, then be
interrupted by a signal such as SIGALRM and raise before resetting the
threadlocal flag. In this scenario, subsequent calls to _populate() in the
same thread will short-circuit erroneously.

The bulk of the method was already wrapped in a try/finally in df41b5a, but
since a signal interrupt can occur at any line executed by the interpreter,
this moves up the try to ensure threadlocal gets reset.

[1]: https://groups.google.com/d/msg/django-developers/D_bIeinKHjE/4NmVQUJqAgAJ
2017-09-22 10:16:05 -04:00
.tx Removed contrib-messages entry in Transifex config file 2016-06-29 21:11:30 +02:00
django Refs #28593 -- Made URLResolver._populate() more resilient to signal interrupts. 2017-09-22 10:16:05 -04:00
docs Refs #28595 -- Added a hook to add execute wrappers for database queries. 2017-09-21 12:13:09 -04:00
extras Refs #23919 -- Removed Python 2 reference in django_bash_completion. 2017-07-10 08:54:52 -04:00
js_tests Fixed #28295 -- Made admin's URLify.js trim trailing hyphens. 2017-06-13 14:58:30 -04:00
scripts Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
tests Added a test for QuerySet.select_related() reverse caching. 2017-09-21 14:25:42 -04:00
.editorconfig Added Python max_line_length to .editorconfig. 2016-06-13 10:41:56 -04:00
.eslintignore Refs #16501, #26474 -- Added xregexp.js source file. 2016-06-06 09:25:02 -04:00
.eslintrc Fixed #25165 -- Removed inline JavaScript from the admin. 2015-12-05 15:51:57 -05:00
.gitattributes Fixed #19670 -- Applied CachedFilesMixin patterns to specific extensions 2016-03-30 14:34:41 +02:00
.gitignore Fixed #22446 -- Added tox.ini to automate pull request checks. 2016-07-20 14:06:28 -04:00
.hgignore Synced .hgignore with .gitignore 2015-07-01 10:23:05 -04:00
AUTHORS Fixed #28576 -- Added color interpretation method to GDALBand. 2017-09-21 09:42:38 -04:00
CONTRIBUTING.rst Added link to the code of conduct from contributing guides. 2015-04-17 18:12:41 -04:00
Gruntfile.js Fixed qunit tests (coverage still missing). (#7716) 2016-12-19 18:45:37 +01:00
INSTALL Refs #23919 -- Removed misc references to Python 2. 2017-01-21 20:02:00 -05:00
LICENSE Whitespace cleanup. 2013-10-10 16:49:20 -04:00
LICENSE.python Updated Python license for 2016. 2016-01-19 06:43:32 -05:00
MANIFEST.in Simplified MANIFEST.in 2015-12-12 12:07:21 -05:00
README.rst Refs #17453 -- Fixed broken link to #django IRC logs. 2017-07-21 18:09:48 -04:00
package.json Fixed qunit tests (coverage still missing). (#7716) 2016-12-19 18:45:37 +01:00
setup.cfg Refs #23919 -- Removed misc Python 2/3 references. 2017-01-25 13:59:25 -05:00
setup.py Refs #23919 -- Removed misc Python 2/3 references. 2017-01-25 13:59:25 -05:00
tox.ini Refs #23919 -- Removed misc Python 2/3 references. 2017-01-25 13:59:25 -05:00

README.rst

Django is a high-level Python Web framework that encourages rapid development
and clean, pragmatic design. Thanks for checking it out.

All documentation is in the "``docs``" directory and online at
https://docs.djangoproject.com/en/stable/. If you're just getting started,
here's how we recommend you read the docs:

* First, read ``docs/intro/install.txt`` for instructions on installing Django.

* Next, work through the tutorials in order (``docs/intro/tutorial01.txt``,
  ``docs/intro/tutorial02.txt``, etc.).

* If you want to set up an actual deployment server, read
  ``docs/howto/deployment/index.txt`` for instructions.

* You'll probably want to read through the topical guides (in ``docs/topics``)
  next; from there you can jump to the HOWTOs (in ``docs/howto``) for specific
  problems, and check out the reference (``docs/ref``) for gory details.

* See ``docs/README`` for instructions on building an HTML version of the docs.

Docs are updated rigorously. If you find any problems in the docs, or think
they should be clarified in any way, please take 30 seconds to fill out a
ticket here: https://code.djangoproject.com/newticket

To get more help:

* Join the ``#django`` channel on irc.freenode.net. Lots of helpful people hang out
  there. Read the archives at https://botbot.me/freenode/django/.

* Join the django-users mailing list, or read the archives, at
  https://groups.google.com/group/django-users.

To contribute to Django:

* Check out https://docs.djangoproject.com/en/dev/internals/contributing/ for
  information about getting involved.

To run Django's test suite:

* Follow the instructions in the "Unit tests" section of
  ``docs/internals/contributing/writing-code/unit-tests.txt``, published online at
  https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests