Stabilność API¶
Django gwarantuje stabliność i kompatybilność wsteczną API od wersji 1.0. W skrócie, to znaczy, że kod, który pisałeś w jakiejś wersji Django będzie wciąż działał z przyszłymi wydaniami. Możesz musieć wprowadzić małe zmiany podczas upgrade’owania wersji Django, z której korzysta twój projekt: zobacz sekcje „Zmiany niekompatybilne wstecz” notatek o wydaniach dla wersji z której lub wersji z których się upgrade’ujesz.
Co oznacza „stabilny” (ang. stable)¶
W tym kontekście, stabilny oznacza:
Wszystkie publiczne API (wszystkie są w tej dokumentacji) nie będą przeniesione ani nie zostaną zmienione ich nazwy bez dodanych wstecznie kompatybilnych aliasów.
Jeśli do tych API zostaną dodane nowe elementy – co jest całkiem możliwe – nie złamią ani nie zmienią znaczenia istniejących metod. Innymi słowy „stabline” nie (koniecznie) zawsze znaczy „kompletne”.
Jeśli z jakiegoś powodu API określane jako stabilne musi zostać usunięte lub zmienione, zostanie oznaczone jako dezaprobowane, ale pozostanie w API w co najmniej dwóch kolejnych wydaniach. Przy wywołaniu dezaprobowanej metody wyświetlą się ostrzeżenia.
See Oficjalne wydania for more details on how Django’s version numbering scheme works, and how features will be deprecated.
We’ll only break backwards compatibility of these APIs if a bug or security hole makes it completely unavoidable.
Stable APIs¶
In general, everything covered in the documentation – with the exception of anything in the internals area is considered stable.
Wyjątki¶
There are a few exceptions to this stability and backwards-compatibility promise.
Poprawki bezpieczeństwa¶
If we become aware of a security problem – hopefully by someone following our security reporting policy – we’ll do everything necessary to fix it. This might mean breaking backwards compatibility; security trumps the compatibility guarantee.
APIs marked as internal¶
Certain APIs are explicitly marked as „internal” in a couple of ways:
- Some documentation refers to internals and mentions them as such. If the documentation says that something is internal, we reserve the right to change it.
- Functions, methods, and other objects prefixed by a leading underscore
(
_
). This is the standard Python way of indicating that something is private; if any method starts with a single_
, it’s an internal API.