В предыдущих ответах упоминается только получение LANGUAGE
из settings.py , однако существует большая вероятность, что эта переменная будет перезаписана. Таким образом, вы можете получить полный список из django.conf.global_settings.LANGUAGES
from django.db import models
from django.conf.global_settings import LANGUAGES
class ModelWithLanguage(models.Model):
language = models.CharField(max_length=7, choices=LANGUAGES)
Я думаю, вы обнаружите, что большинство людей будут спорить с Redhat по поводу надежности Windows. Сам Glassfish должен работать на любом из них.
Вы, вероятно, должны спросить об этом на Server Fault
Если вы проверите источник Glassfish, в частности ./appserv-commons/src/java/com/sun/enterprise/util/io/FileUtils.java, вы увидите все искажения что Glassfish выполняет, чтобы удалить / переименовать файлы и каталоги в Windows.
Это проблема Windows с ее ограничениями на удаление и переименование открытых файлов.
Там есть всевозможные уловки, включая запрос Сборщик мусора из JVM несколько раз в надежде закрыть файловый поток, «псевдо» переименование, циклы ожидания в спящем режиме.
Некоторые примеры:
/**
*Attempts to delete files that could not be deleted earlier and were not overwritten.
*<p>
*On Windows, the method requests garbage collection which may unlock locked
*files. (The JarFile finalizer closes the file.)
/*
*On Windows, as long as not all leftover files have been cleaned and we have not
*run the max. number of retries, try again to trigger gc and delete
*each remaining leftover file.
*/
/**
* Windows has BIG issues renaming a directory that is open somnewhere -- e.g. if
* a DOS box is opened anywhere in that directory.
* This method will try to do a "virtual renaming" if there are problems
* I.e. it attempts to do a simple rename, if that fails it will copy everything under
* the original directory to the renamed directory. Then it will delete everything
* under the original directory that the OS will allow it to.
На практике это иногда приводит к неудачным развертываниям или повторным развертываниям в Windows, поскольку некоторые файлы не могут быть удалены или перемещены и в конечном итоге останутся позади. Из 50 или около того экземпляров Glassfish я запускаю