New 1.2 beta version of Djnago
web framework has been
releasedWhat has changed since 1.1.1?
Changes in protection against
forgery of cross-domain requests. Changes are primarily associated with simplification and some refactoring in
midlets . More importantly, protection will be enabled by default and perhaps your POST views will need to be improved.
Here more')
Changed LazyObject. For a more correct introspection, it led to a more general form, instead of get_all_members () __dir __ () and __members__ will now be used (the thing is poorly documented and it will be very good if someone tells the details)
A _state was added to the model dictionary (__dict__) to support several databases in addition to the fields. This is worth considering if you use and filter, if you use __dict__ to get the fields of models.
To support multiple databases, field models have been changed. Added information about the current connection to the signatures of the get_db_prep _ * () methods. These methods are designed to convert python types and databases. If the base is not important for your field, then for these purposes you have introduced 2 new methods get_prep_value, get_prep_lookup and most likely just a simple renaming.
Significantly accelerated cache templates. What is especially noticeable when using many small subpatterns. But if you use non-standard template tags, then it is important to make sure that your tags are
thread-safe.In the "and", "not", "or" templates are now reserved keywords, and if you used them for some reason as variables, then you will have to edit your code. “If” has also been reworked to a more familiar look.
{% if a != b %}
...
{% endif %}
or even
<div
{% if user.email|lower == message.recipient|lower %}
class="highlight"
{% endif %}
>{{ message }} [/div]
A test runner for any number of failed tests returns an exit code (exit code) 1. This is due to the fact that, according to the standard, the maximum exit code is 255, and the number of failed tests may be more. In addition, runners should now be inherited from classes. Older functionalities are marked as obsolete.
The --failfast option has been added to the test runner, tests are run until the first failure.
In the meaning of cookies, the characters ',', ';' are now considered unsafe and are encoded as \ 054 and \ 073 respectively. The reason is not correct work with Kukak in browsers ie and safari
SMTPConnection - is marked obsolete in favor of the universal mail access interface:
Instead
from django.core.mail import SMTPConnection
connection = SMTPConnection()
It is recommended to use:
from django.core.mail import get_connection
connection = get_connection()
This allows you to support multiple backends for sending mail. For example, you can now implement sending mail to memory, to file, or immediately to / dev / null
The old way to set up the database was deprecated.
After the introduction of support for several databases at the same time, the old way of setting up the database was declared obsolete. Now instead of DATABASE_ENGINE, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD
It is necessary to use the dictionary:
DATABASES = {
'default': {
'NAME': 'test_db',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'myusername',
'PASSWORD': 's3krit',
}
}
To version 1.4 old both ways will be available.
django.contrib.syndication.feeds.Feed has been marked obsolete. You must use the django.contrib.syndication.views.Feed interface is the same but can be used as a view.
Added permissions at the object level. Django does not use this feature, but your backends can have
details here . (I did not try it myself. If someone tells you why it is and how it should work, I will be very happy)
Added separate permissions for authorized and anonymous users.
I remind you of the release schedule:
March 2, 2010 Django 1.2 rc1. Freeze localization
March 9, 2010 Django 1.2 final release.