コード例 #1
0
ファイル: settings.py プロジェクト: yu45020/MangAdventure
#:
#: .. admonition:: TODO
#:    :class: warning
#:
#:    This is not enabled yet.
USE_I18N = False

#: Enable localized formatting of data. See :setting:`USE_L10N`.
USE_L10N = True

#: Enable timezone-aware datetimes. See :setting:`USE_TZ`.
USE_TZ = True

#: A string representing the language code for this installation.
#: See :setting:`LANGUAGE_CODE`.
LANGUAGE_CODE = env.get('LANG_CODE', 'en-us')

#: The name of the cookie to use for the language cookie.
#: See :setting:`LANGUAGE_COOKIE_NAME`.
LANGUAGE_COOKIE_NAME = 'mangadv_lang'

#: Set the ``HttpOnly`` flag on the language cookie.
#: See :setting:`LANGUAGE_COOKIE_HTTPONLY`.
LANGUAGE_COOKIE_HTTPONLY = True

#: Prevent the language cookie from being sent in cross-site requests.
#: See :setting:`LANGUAGE_COOKIE_SAMESITE`.
LANGUAGE_COOKIE_SAMESITE = 'Strict'

#: A list of all available languages. See :setting:`LANGUAGES`.
LANGUAGES = [
コード例 #2
0
 def test_get(self, env: yaenv.Env):
     """it returns default values for optional variables"""
     assert env.get('BLANK', 'default') == ''
     assert env.get('MISSING') is None
     assert env.get('MISSING', 'default') == 'default'
コード例 #3
0
#:
#: .. admonition:: TODO
#:    :class: warning
#:
#:    This is not enabled yet.
USE_I18N = False

#: Enable localized formatting of data. See :setting:`USE_L10N`.
USE_L10N = True

#: Enable timezone-aware datetimes. See :setting:`USE_TZ`.
USE_TZ = True

#: A string representing the language code for this installation.
#: See :setting:`LANGUAGE_CODE`.
LANGUAGE_CODE = env.get('LANG_CODE', 'en-us')

#: The name of the cookie to use for the language cookie.
#: See :setting:`LANGUAGE_COOKIE_NAME`.
LANGUAGE_COOKIE_NAME = 'mangadv_lang'

#: Set the ``HttpOnly`` flag on the language cookie.
#: See :setting:`LANGUAGE_COOKIE_HTTPONLY`.
LANGUAGE_COOKIE_HTTPONLY = True

#: Prevent the language cookie from being sent in cross-site requests.
#: See :setting:`LANGUAGE_COOKIE_SAMESITE`.
LANGUAGE_COOKIE_SAMESITE = 'Strict'

#: A list of all available languages. See :setting:`LANGUAGES`.
LANGUAGES = [