When was django 1.4 release




















Django 1. As such, the minimum Python version required for Django is now 2. This change should affect only a small number of Django users, as most operating-system vendors today are shipping Python 2. Django does not support Python 3. A document outlining our full timeline for deprecating Python 2. The new django. See the documentation for more details and concrete examples. This method allows for more efficient creation of multiple objects in the ORM.

It can provide significant performance increases if you have many objects. Django makes use of this internally, meaning some operations such as database setup for test suites have seen a performance benefit as a result.

This method returns a new QuerySet that will prefetch each of the specified related lookups in a single batch as soon as the query begins to be evaluated. This allows you to fix a very common performance problem in which your code ends up doing O n database queries or worse if objects on your primary QuerySet each have many related objects that you also need. Thus, Django 1. You can also easily choose a different algorithm including the popular bcrypt algorithm.

For more details, see How Django stores passwords. While Django will be careful to maintain compatibility with older browsers, this change means that you can use any HTML5 features you need in admin pages without having to lose HTML validity or override the provided templates to change the doctype. Prior to Django 1. The admin change list now supports sorting on multiple columns.

It respects all elements of the ordering attribute, and sorting on multiple columns by clicking on headers is designed to mimic the behavior of desktop GUIs.

Admin inlines will now only allow those actions for which the user has permission. For ManyToMany relationships with an auto-created intermediate model which does not have its own permissions , the change permission for the related model determines if the user has the permission to add, change or delete relationships. See the cryptographic signing docs for more information. See the cookie-based session backend docs for more information. The previous FormWizard from the formtools contrib app has been replaced with a new implementation based on the class-based views introduced in Django 1.

The latter uses the tools for cryptographic signing also introduced in Django 1. See the form wizard docs for more information. A lazily evaluated version of django. The contextual translation support introduced in Django 1.

Library to ease the creation of template tags that store data in a specified context variable. For example:. This was done in order to provide detailed template source location information in the debug page. In Django 1. Instead, the original exception is annotated with the source information. Added a filter which truncates a string to be no longer than the specified number of characters. See the documentation for truncatechars for more details. See the CachedStaticFilesStorage docs for more information.

See the CSRF docs for more information. You may override or customize the default filtering by writing a custom filter. For more information see the docs on Filtering error reports. The previously added support for IPv6 addresses when using the runserver management command in Django 1. These fix some issues with the previous manage. The previous manage. The old-style manage. The new recommended manage. If settings, URLconfs, and apps within the project are imported or referenced using the project name prefix e.

You could import mysite. Anything imported as a top-level module can be placed adjacent to the new manage. If the same code is imported inconsistently some places with the project prefix, some places without it , the imports will need to be cleaned up when switching to the new manage. The startproject management command now adds a wsgi.

The built-in development server now supports using an externally-defined WSGI callable, so as to make it possible to run runserver with the same WSGI configuration that is used for deployment. The startapp and startproject management commands got a --template option for specifying a path or URL to a custom app or project template.

You can also now provide a destination directory as the second argument to both startapp and startproject :. For more information, see the startapp and startproject documentation. Time zone support is enabled by default in new projects created with startproject.

If you want to use this feature in an existing project, there is a migration guide. This change makes it easier to scan a stacktrace for issues in user code. Tablespace support in PostgreSQL. The CSRF-protection system is based on a random nonce sent to the client in a cookie which must be sent by the client on future requests and, in forms, a hidden value which must be submitted back with the form.

The caching framework includes an option to cache responses to anonymous i. When the first anonymous request to a given page is by a client which did not have a CSRF cookie, the cache framework will also cache the CSRF cookie and serve the same nonce to other anonymous clients who do not have a CSRF cookie.

This can allow an attacker to obtain a valid CSRF cookie value and perform attacks which bypass the check for the cookie. To remedy this, the caching framework will no longer cache such responses. The heuristic for this will be:. If a query is performed without first converting values to the appropriate type, this can produce unexpected results, similar to what would occur if the query itself had been manipulated.

However, three model field classes did not correctly convert their arguments:. These three fields have been updated to convert their arguments to the correct types before querying. Because fixtures are a raw import, they should explicitly specify all field values, regardless of field options on the model.

The development server is now is multithreaded by default. Use the runserver --nothreading option to disable the use of threading in the development server:. If using a version of the Python-Markdown library less than 2. FormMixin class was returning the class initial dictionary.

This has been fixed to return a copy of this dictionary, so form instances can modify their initial data without messing with the class variable. Please see the documentation for the correct way to use this decorator. When we added logging support in Django in 1.

AdminEmailHandler , attached to the 'django. In order to maintain the established behavior of error emails, the 'django. To increase the flexibility of error logging for requests, the 'django. This will become a deprecation warning in Django 1. Databrowse has not seen active development for some time, and this does not show any sign of changing. There had been a suggestion for a GSOC project to integrate the functionality of databrowse into the admin, but no progress was made. While Databrowse has been deprecated, an enhancement of django.

This function temporarily modified sys. This function is now deprecated, as its path workarounds are no longer needed with the new manage. This function was previously used by manage. It is identical to django. Neither of these functions is documented as part of the public API, but a deprecation path is needed due to use in existing manage.

They used to be attributes of the filter function:. However, this technique caused some problems in combination with decorators, especially stringfilter. Now, the flags are keyword arguments of register. See filters and auto-escaping for more information. This behavior was never documented. Since it is unpythonic, it was removed in Django 1. If you relied on it, you must edit your settings file to list all your applications explicitly. This attribute was confusingly named HttpRequest.

In previous versions, Paginator objects used in sitemap classes were cached, which could result in stale site maps. Depending on what your items method is doing, this may have a negative performance impact. To mitigate the performance impact, consider using the caching framework within your Sitemap subclass. Versions of Python-Markdown earlier than 2. As a security issue, earlier versions of this library will not be supported by the markup contrib app in 1.

Offline Django 3. Django is a registered trademark of the Django Software Foundation. Django The web framework for perfectionists with deadlines. Documentation Search: Search. Getting Help el es fr id it ja ko pl pt-br zh-hans Language: en 1.

Other notable new features in Django 1. Some nice security additions, including improved password hashing featuring PBKDF2 and bcrypt support , new tools for cryptographic signing , several CSRF improvements , and simple clickjacking protection. An updated default project layout and manage. Support for in-browser testing frameworks like Selenium. Reasons for using this feature include: Customizing date and time display for users around the world.

Storing datetimes in UTC for database portability and interoperability. Avoiding data corruption problems around DST transitions. Updated default project layout and manage. For example: register. This change makes it easier to scan a stacktrace for issues in application code. Tablespace support in PostgreSQL. In the documentation, a helpful security overview page. The django. Importing it from the old location will still work, but you should update your imports.

The collectstatic management command now has a --clear option to delete all files at the destination before copying or linking the static files. A new response handler has been added as 'django. You can set your own handler by setting the value of django. The makemessages command uses a new and more accurate lexer, JsLex , for extracting translatable strings from JavaScript files.

This should make it easier to read when debugging interaction with client-side JavaScript. Backwards incompatible changes in 1. Form-related hashes: these have a much shorter lifetime and are relevant only for the short window where a user might fill in a form generated by the pre-upgrade Django instance and try to submit it to the upgraded Django instance: contrib.

FormWizard security hash Consequences: The user will see an error about the form having expired and will be sent back to the first page of the wizard, losing the data entered so far. Time period: The amount of time you expect users to take filling out the affected forms.

Time period: The amount of time you expect user to take filling out such forms. This means that if you upgrade to 1. After you confirm your app works well with Django 1. It raises an exception for aware time objects. It includes milliseconds for datetime and time objects. There is still some precision loss, because Python stores microseconds 6 digits and JSON only supports milliseconds 3 digits. If you rely on the feature and want to restore the old behavior, use a custom comment model manager to exclude the user group, like this: from django.

In the rare case you relied on the mixin parameter, you can easily achieve the same by overriding the open method, like this: from django. YAML deserializer now uses yaml.



0コメント

  • 1000 / 1000