<commit_before>Backwards incompatible changes in 1.4
=====================================

This page mirrors the *Backwards incompatible changes* section in the `Django
1.4 release notes`_.  Please refer to it when you make changes to this page.
The goal of this document is to spot any places where upgrading to Django 1.4
might break our app.

SECRET_KEY setting is required
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  The ``SECRET_KEY`` is already populated.

django.contrib.admin
~~~~~~~~~~~~~~~~~~~~

The ``ADMIN_MEDIA_PREFIX`` setting has been removed.  Admin static files might
be missing after upgrading.  This can be fixed with a one-time copying of the
files from the Django distribution to the right place on the web server (or
S3).

For example:

.. code-block:: console

    $ cp -rf \
        /venv/lib/python2.6/site-packages/django/contrib/admin/static/admin \
        /opt/unisubs/media/.'

The vagrant environmnet has a ``fixadminmedia`` bash `alias`_.

Supported browsers for the admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  Obviously, nobody who uses our admin interface still uses IE6.

Removed admin icons
~~~~~~~~~~~~~~~~~~~

Not critical.  Some of our admin icons have been missing for a while.

CSS class names in admin forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Compatibility with old signed data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  Only applies to upgrades from Django 1.2.

django.contrib.flatpages
~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  We aren't using ``flatpages``.

Serialization of :class:`~datetime.datetime` and :class:`~datetime.time`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The only place where this could be an issue is when loading fixtures and those
will still work.

``supports_timezone`` changed to ``False`` for SQLite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``MySQLdb``-specific exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.  ``grep -r OperationalError *`` comes back empty.

Database connection's thread-locality
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

``COMMENTS_BANNED_USERS_GROUP`` setting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

``IGNORABLE_404_STARTS`` and ``IGNORABLE_404_ENDS`` settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

CSRF protection extended to PUT and DELETE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Password reset view now accepts ``subject_template_name``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``django.core.template_loaders``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``django.db.models.fields.URLField.verify_exists``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``django.core.files.storage.Storage.open``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

YAML deserializer now uses ``yaml.safe_load``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

Session cookies now have the ``httponly`` flag by default
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``httponly`` has been `turned off`_ for now.

The ``urlize`` filter no longer escapes every URL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``assertTemplateUsed`` and ``assertTemplateNotUsed`` as context manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Database connections after running the test suite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Output of ``manage.py help <help>``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``extends`` template tag
~~~~~~~~~~~~~~~~~~~~~~~~

Loading some incomplete fixtures no longer works
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Building a new vagrant VM works fine so I think it's safe to assume that our
fixtures are working fine.

Development Server Multithreading
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I haven't noticed anything strange.  If it becomes a problem, add the
``--nothreading`` flag.

Attributes disabled in markdown when safe mode set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FormMixin get_initial returns an instance-specific dictionary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _Django 1.4 release notes: https://docs.djangoproject.com/en/dev/releases/1.4/#backwards-incompatible-changes-in-1-4
.. _alias: https://github.com/pculture/unisubs/commit/cb712b3ca55c8862105f4fc456f993947d149852
.. _turned off: https://github.com/pculture/unisubs/commit/ed79043098052978e7e632c1a9d473baf72f2dfb
<commit_msg>More django 1.4 compatibility data<commit_after>Backwards incompatible changes in 1.4
=====================================

This page mirrors the *Backwards incompatible changes* section in the `Django
1.4 release notes`_.  Please refer to it when you make changes to this page.
The goal of this document is to spot any places where upgrading to Django 1.4
might break our app.

SECRET_KEY setting is required
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  The ``SECRET_KEY`` is already populated.

django.contrib.admin
~~~~~~~~~~~~~~~~~~~~

The ``ADMIN_MEDIA_PREFIX`` setting has been removed.  Admin static files might
be missing after upgrading.  This can be fixed with a one-time copying of the
files from the Django distribution to the right place on the web server (or
S3).

For example:

.. code-block:: console

    $ cp -rf \
        /venv/lib/python2.6/site-packages/django/contrib/admin/static/admin \
        /opt/unisubs/media/.'

The vagrant environmnet has a ``fixadminmedia`` bash `alias`_.

Supported browsers for the admin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  Obviously, nobody who uses our admin interface still uses IE6.

Removed admin icons
~~~~~~~~~~~~~~~~~~~

Not critical.  Some of our admin icons have been missing for a while.

CSS class names in admin forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Compatibility with old signed data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  Only applies to upgrades from Django 1.2.

django.contrib.flatpages
~~~~~~~~~~~~~~~~~~~~~~~~

No issues.  We aren't using ``flatpages``.

Serialization of :class:`~datetime.datetime` and :class:`~datetime.time`
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The only place where this could be an issue is when loading fixtures and those
will still work.

``supports_timezone`` changed to ``False`` for SQLite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``MySQLdb``-specific exceptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.  ``grep -r OperationalError *`` comes back empty.

Database connection's thread-locality
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

``COMMENTS_BANNED_USERS_GROUP`` setting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

``IGNORABLE_404_STARTS`` and ``IGNORABLE_404_ENDS`` settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

CSRF protection extended to PUT and DELETE
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues here.

Password reset view now accepts ``subject_template_name``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``django.core.template_loaders``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``django.db.models.fields.URLField.verify_exists``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``django.core.files.storage.Storage.open``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

YAML deserializer now uses ``yaml.safe_load``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

Session cookies now have the ``httponly`` flag by default
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``httponly`` has been `turned off`_ for now.

The ``urlize`` filter no longer escapes every URL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

``assertTemplateUsed`` and ``assertTemplateNotUsed`` as context manager
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Database connections after running the test suite
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Not critical.

Output of ``manage.py help <help>``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

No issues.

``extends`` template tag
~~~~~~~~~~~~~~~~~~~~~~~~

Loading some incomplete fixtures no longer works
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Building a new vagrant VM works fine so I think it's safe to assume that our
fixtures are working fine.

Development Server Multithreading
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I haven't noticed anything strange.  If it becomes a problem, add the
``--nothreading`` flag.

Attributes disabled in markdown when safe mode set
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

FormMixin get_initial returns an instance-specific dictionary
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. _Django 1.4 release notes: https://docs.djangoproject.com/en/dev/releases/1.4/#backwards-incompatible-changes-in-1-4
.. _alias: https://github.com/pculture/unisubs/commit/cb712b3ca55c8862105f4fc456f993947d149852
.. _turned off: https://github.com/pculture/unisubs/commit/ed79043098052978e7e632c1a9d473baf72f2dfb

{'fraction_non_alphanumeric': 0.3398829892924164, 'fraction_numerical': 0.01766199359752732, 'mean_word_length': 6.2538030424339475, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6468491', 'n_tokens_mistral': 2497, 'n_tokens_neox': 2199, 'n_words': 761}