1
0
mirror of https://github.com/django/django.git synced 2024-12-23 17:46:27 +00:00
django/docs/topics/localflavor.txt
Iacopo Spalletti 6da4ce5365 [1.8.x] Fixed #23814 -- Pointed localflavor documentation to external package
Edited localflavor doc to point to the external package documentation,
leaving just the 'How to migrate' section in Django.

Backport of 87fed94440 from master.
2015-03-22 15:36:44 +01:00

54 lines
1.6 KiB
Plaintext

==========================
The "local flavor" add-ons
==========================
Historically, Django has shipped with ``django.contrib.localflavor`` --
assorted pieces of code that are useful for particular countries or cultures.
This code is now distributed separately from Django, for easier maintenance
and to trim the size of Django's codebase.
See the official documentation for more information:
https://django-localflavor.readthedocs.org/
.. _localflavor-packages:
Code is hosted on github at https://github.com/django/django-localflavor.
.. _localflavor-how-to-migrate:
How to migrate
==============
If you've used the old ``django.contrib.localflavor`` package or one of the
temporary ``django-localflavor-*`` releases, follow these two easy steps to
update your code:
1. Install the third-party ``django-localflavor`` package from PyPI.
2. Change your app's import statements to reference the new package.
For example, change this::
from django.contrib.localflavor.fr.forms import FRPhoneNumberField
...to this::
from localflavor.fr.forms import FRPhoneNumberField
The code in the new package is the same (it was copied directly from Django),
so you don't have to worry about backwards compatibility in terms of
functionality. Only the imports have changed.
.. _localflavor-deprecation-policy:
Deprecation policy
==================
In Django 1.5, importing from ``django.contrib.localflavor`` will result in a
``DeprecationWarning``. This means your code will still work, but you should
change it as soon as possible.
In Django 1.6, importing from ``django.contrib.localflavor`` will no longer
work.