2008-08-23 22:25:40 +00:00
|
|
|
==========================
|
|
|
|
The "local flavor" add-ons
|
|
|
|
==========================
|
|
|
|
|
2012-10-12 22:00:35 +00:00
|
|
|
Historically, Django has shipped with ``django.contrib.localflavor`` --
|
|
|
|
assorted pieces of code that are useful for particular countries or cultures.
|
2012-12-24 22:10:40 +00:00
|
|
|
This code is now distributed separately from Django, for easier maintenance
|
|
|
|
and to trim the size of Django's codebase.
|
2012-10-12 22:00:35 +00:00
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
See the official documentation for more information:
|
|
|
|
|
|
|
|
https://django-localflavor.readthedocs.org/
|
2012-10-12 22:00:35 +00:00
|
|
|
|
2015-03-22 10:46:07 +00:00
|
|
|
.. _localflavor-packages:
|
2012-12-26 13:33:47 +00:00
|
|
|
|
2015-03-22 10:46:07 +00:00
|
|
|
Code is hosted on github at https://github.com/django/django-localflavor.
|
2012-12-24 22:10:40 +00:00
|
|
|
|
|
|
|
.. _localflavor-how-to-migrate:
|
|
|
|
|
|
|
|
How to migrate
|
|
|
|
==============
|
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
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:
|
2012-12-24 22:10:40 +00:00
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
1. Install the third-party ``django-localflavor`` package from PyPI.
|
2012-12-24 22:10:40 +00:00
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
2. Change your app's import statements to reference the new package.
|
2012-12-24 22:10:40 +00:00
|
|
|
|
|
|
|
For example, change this::
|
|
|
|
|
|
|
|
from django.contrib.localflavor.fr.forms import FRPhoneNumberField
|
|
|
|
|
|
|
|
...to this::
|
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
from localflavor.fr.forms import FRPhoneNumberField
|
2012-12-24 22:10:40 +00:00
|
|
|
|
2013-07-26 09:48:24 +00:00
|
|
|
The code in the new package is the same (it was copied directly from Django),
|
2012-12-24 22:10:40 +00:00
|
|
|
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.
|