... so far. >>> q . choice_set . all () <QuerySet []> # Create three choices. >>> q . choice_set . create ( choice_text = "Not much" , votes = 0 ) <Choice: Not much> >>> q . choice_set . create ( choice_text = "The sky" , votes = 0 ) <Choice: The sky> >> ... up?> # And vice versa: Question objects get access to Choice objects. >>> q . choice_set . all () <QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]> >>> q . choice_set . count () 3 # The API automatically follows relati ... iable we created above). >>> Choice . objects . filter ( question__pub_date__year = current_year ) <QuerySet [<Choice: Not much>, <Choice: The sky>, <Choice: Just hacking again>]> # Let's delete one of the choices. Use delete() for that. >>> c = q . ... ... any callable as the callback in URLconfs (previously, only strings that referred to callables were allowed). This allows a much more natural use of URLconfs. For example, this URLconf: from django.conf.urls.defaults import * urlpatterns = patterns ( ... rialization formats , that will be loaded into your database at the start of your tests. This makes testing with real data much easier. See the testing documentation for the full details. Improvements to the admin interface A small change, but a very ... ... l instance's save() method will not perform any validation of the instance's data. Improved CSRF protection Django now has much improved protection against Cross-Site Request Forgery (CSRF) attacks . This type of attack occurs when a malicious websit ... le , or to memory . You can even configure all email to be thrown away . "Smart" if tag The if tag has been upgraded to be much more powerful. First, we've added support for comparison operators. No longer will you have to type: {% ifnotequal a b %} ... are broken into lots of smaller subtemplates (using the {% extends %} or {% include %} tags). As a side effect, it is now much easier to support non-Django template languages. Class-based template loaders As part of the changes made to introduce Tem ... ... 't test subsequent releases against Python 3.2 either. Upstream support for Python 3.2 ends February 2016 so we don't find much value in providing security updates for a version of Python that could be insecure. To read more about the decision and to ... ... reSQL when the number of objects is a multiple plus one of batch_size ( #27385 ). Prevented i18n_patterns() from using too much of the URL as the language to fix a use case for prefix_default_language=False ( #27063 ). Replaced a possibly incorrect r ... ... g framework . Test performance improvements Tests written using Django's testing framework now run dramatically faster (as much as 10 times faster in many cases). This was accomplished through the introduction of transaction-based tests: when using d ... hips with one pre-defined admin action to delete a group of objects in one fell swoop. 条件付きのビュー処理 Django now has much better support for conditional view processing using the standard ETag and Last-Modified HTTP headers. This means you can ... ... r prefetch_related_objects() . Using FETCH_PEERS can reduce most cases of the "N+1 queries problem" to two queries without much effort. The "peer" instances are tracked in a list of weak references, to avoid memory leaks where some peer instances are ... ... . Fixed an infinite loop bug for certain cyclic migration dependencies, and made the error message for cyclic dependencies much more helpful. Added missing index_together handling for SQLite ( #23880 ). Fixed a crash when RunSQL SQL content was colle ... ... re about the specifics in 非同期サポート documentation. You are free to mix async and sync views, middleware, and tests as much as you want. Django will ensure that you always end up with the right execution context. We expect most projects will keep ... ports: TREE format on MySQL 8.0.16+, analyze option on MySQL 8.0.18+ and MariaDB. Added PositiveBigIntegerField which acts much like a PositiveIntegerField except that it only allows values under a certain (database-dependent) limit. Values from 0 to ... ... つかもしれないいくつかの一般的なパターンを示します。 Having your Django application serve static files While web servers are much better and faster at serving static files, it is possible to have Django serve them using community-maintained packages. T ... 2026年10月08日