global_settings.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. """
  2. Default Django settings. Override these with settings in the module pointed to
  3. by the DJANGO_SETTINGS_MODULE environment variable.
  4. """
  5. # This is defined here as a do-nothing function because we can't import
  6. # django.utils.translation -- that module depends on the settings.
  7. def gettext_noop(s):
  8. return s
  9. ####################
  10. # CORE #
  11. ####################
  12. DEBUG = False
  13. # Whether the framework should propagate raw exceptions rather than catching
  14. # them. This is useful under some testing situations and should never be used
  15. # on a live site.
  16. DEBUG_PROPAGATE_EXCEPTIONS = False
  17. # People who get code error notifications. In the format
  18. # [('Full Name', 'email@example.com'), ('Full Name', 'anotheremail@example.com')]
  19. ADMINS = []
  20. # List of IP addresses, as strings, that:
  21. # * See debug comments, when DEBUG is true
  22. # * Receive x-headers
  23. INTERNAL_IPS = []
  24. # Hosts/domain names that are valid for this site.
  25. # "*" matches anything, ".example.com" matches example.com and all subdomains
  26. ALLOWED_HOSTS = []
  27. # Local time zone for this installation. All choices can be found here:
  28. # https://en.wikipedia.org/wiki/List_of_tz_zones_by_name (although not all
  29. # systems may support all possibilities). When USE_TZ is True, this is
  30. # interpreted as the default user time zone.
  31. TIME_ZONE = "America/Chicago"
  32. # If you set this to True, Django will use timezone-aware datetimes.
  33. USE_TZ = False
  34. # RemovedInDjango50Warning: It's a transitional setting helpful in migrating
  35. # from pytz tzinfo to ZoneInfo(). Set True to continue using pytz tzinfo
  36. # objects during the Django 4.x release cycle.
  37. USE_DEPRECATED_PYTZ = False
  38. # Language code for this installation. All choices can be found here:
  39. # http://www.i18nguy.com/unicode/language-identifiers.html
  40. LANGUAGE_CODE = "en-us"
  41. # Languages we provide translations for, out of the box.
  42. LANGUAGES = [
  43. ("af", gettext_noop("Afrikaans")),
  44. ("ar", gettext_noop("Arabic")),
  45. ("ar-dz", gettext_noop("Algerian Arabic")),
  46. ("ast", gettext_noop("Asturian")),
  47. ("az", gettext_noop("Azerbaijani")),
  48. ("bg", gettext_noop("Bulgarian")),
  49. ("be", gettext_noop("Belarusian")),
  50. ("bn", gettext_noop("Bengali")),
  51. ("br", gettext_noop("Breton")),
  52. ("bs", gettext_noop("Bosnian")),
  53. ("ca", gettext_noop("Catalan")),
  54. ("ckb", gettext_noop("Central Kurdish (Sorani)")),
  55. ("cs", gettext_noop("Czech")),
  56. ("cy", gettext_noop("Welsh")),
  57. ("da", gettext_noop("Danish")),
  58. ("de", gettext_noop("German")),
  59. ("dsb", gettext_noop("Lower Sorbian")),
  60. ("el", gettext_noop("Greek")),
  61. ("en", gettext_noop("English")),
  62. ("en-au", gettext_noop("Australian English")),
  63. ("en-gb", gettext_noop("British English")),
  64. ("eo", gettext_noop("Esperanto")),
  65. ("es", gettext_noop("Spanish")),
  66. ("es-ar", gettext_noop("Argentinian Spanish")),
  67. ("es-co", gettext_noop("Colombian Spanish")),
  68. ("es-mx", gettext_noop("Mexican Spanish")),
  69. ("es-ni", gettext_noop("Nicaraguan Spanish")),
  70. ("es-ve", gettext_noop("Venezuelan Spanish")),
  71. ("et", gettext_noop("Estonian")),
  72. ("eu", gettext_noop("Basque")),
  73. ("fa", gettext_noop("Persian")),
  74. ("fi", gettext_noop("Finnish")),
  75. ("fr", gettext_noop("French")),
  76. ("fy", gettext_noop("Frisian")),
  77. ("ga", gettext_noop("Irish")),
  78. ("gd", gettext_noop("Scottish Gaelic")),
  79. ("gl", gettext_noop("Galician")),
  80. ("he", gettext_noop("Hebrew")),
  81. ("hi", gettext_noop("Hindi")),
  82. ("hr", gettext_noop("Croatian")),
  83. ("hsb", gettext_noop("Upper Sorbian")),
  84. ("hu", gettext_noop("Hungarian")),
  85. ("hy", gettext_noop("Armenian")),
  86. ("ia", gettext_noop("Interlingua")),
  87. ("id", gettext_noop("Indonesian")),
  88. ("ig", gettext_noop("Igbo")),
  89. ("io", gettext_noop("Ido")),
  90. ("is", gettext_noop("Icelandic")),
  91. ("it", gettext_noop("Italian")),
  92. ("ja", gettext_noop("Japanese")),
  93. ("ka", gettext_noop("Georgian")),
  94. ("kab", gettext_noop("Kabyle")),
  95. ("kk", gettext_noop("Kazakh")),
  96. ("km", gettext_noop("Khmer")),
  97. ("kn", gettext_noop("Kannada")),
  98. ("ko", gettext_noop("Korean")),
  99. ("ky", gettext_noop("Kyrgyz")),
  100. ("lb", gettext_noop("Luxembourgish")),
  101. ("lt", gettext_noop("Lithuanian")),
  102. ("lv", gettext_noop("Latvian")),
  103. ("mk", gettext_noop("Macedonian")),
  104. ("ml", gettext_noop("Malayalam")),
  105. ("mn", gettext_noop("Mongolian")),
  106. ("mr", gettext_noop("Marathi")),
  107. ("ms", gettext_noop("Malay")),
  108. ("my", gettext_noop("Burmese")),
  109. ("nb", gettext_noop("Norwegian Bokmål")),
  110. ("ne", gettext_noop("Nepali")),
  111. ("nl", gettext_noop("Dutch")),
  112. ("nn", gettext_noop("Norwegian Nynorsk")),
  113. ("os", gettext_noop("Ossetic")),
  114. ("pa", gettext_noop("Punjabi")),
  115. ("pl", gettext_noop("Polish")),
  116. ("pt", gettext_noop("Portuguese")),
  117. ("pt-br", gettext_noop("Brazilian Portuguese")),
  118. ("ro", gettext_noop("Romanian")),
  119. ("ru", gettext_noop("Russian")),
  120. ("sk", gettext_noop("Slovak")),
  121. ("sl", gettext_noop("Slovenian")),
  122. ("sq", gettext_noop("Albanian")),
  123. ("sr", gettext_noop("Serbian")),
  124. ("sr-latn", gettext_noop("Serbian Latin")),
  125. ("sv", gettext_noop("Swedish")),
  126. ("sw", gettext_noop("Swahili")),
  127. ("ta", gettext_noop("Tamil")),
  128. ("te", gettext_noop("Telugu")),
  129. ("tg", gettext_noop("Tajik")),
  130. ("th", gettext_noop("Thai")),
  131. ("tk", gettext_noop("Turkmen")),
  132. ("tr", gettext_noop("Turkish")),
  133. ("tt", gettext_noop("Tatar")),
  134. ("udm", gettext_noop("Udmurt")),
  135. ("uk", gettext_noop("Ukrainian")),
  136. ("ur", gettext_noop("Urdu")),
  137. ("uz", gettext_noop("Uzbek")),
  138. ("vi", gettext_noop("Vietnamese")),
  139. ("zh-hans", gettext_noop("Simplified Chinese")),
  140. ("zh-hant", gettext_noop("Traditional Chinese")),
  141. ]
  142. # Languages using BiDi (right-to-left) layout
  143. LANGUAGES_BIDI = ["he", "ar", "ar-dz", "ckb", "fa", "ur"]
  144. # If you set this to False, Django will make some optimizations so as not
  145. # to load the internationalization machinery.
  146. USE_I18N = True
  147. LOCALE_PATHS = []
  148. # Settings for language cookie
  149. LANGUAGE_COOKIE_NAME = "django_language"
  150. LANGUAGE_COOKIE_AGE = None
  151. LANGUAGE_COOKIE_DOMAIN = None
  152. LANGUAGE_COOKIE_PATH = "/"
  153. LANGUAGE_COOKIE_SECURE = False
  154. LANGUAGE_COOKIE_HTTPONLY = False
  155. LANGUAGE_COOKIE_SAMESITE = None
  156. # If you set this to True, Django will format dates, numbers and calendars
  157. # according to user current locale.
  158. USE_L10N = True
  159. # Not-necessarily-technical managers of the site. They get broken link
  160. # notifications and other various emails.
  161. MANAGERS = ADMINS
  162. # Default charset to use for all HttpResponse objects, if a MIME type isn't
  163. # manually specified. It's used to construct the Content-Type header.
  164. DEFAULT_CHARSET = "utf-8"
  165. # Email address that error messages come from.
  166. SERVER_EMAIL = "root@localhost"
  167. # Database connection info. If left empty, will default to the dummy backend.
  168. DATABASES = {}
  169. # Classes used to implement DB routing behavior.
  170. DATABASE_ROUTERS = []
  171. # The email backend to use. For possible shortcuts see django.core.mail.
  172. # The default is to use the SMTP backend.
  173. # Third-party backends can be specified by providing a Python path
  174. # to a module that defines an EmailBackend class.
  175. EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
  176. # Host for sending email.
  177. EMAIL_HOST = "localhost"
  178. # Port for sending email.
  179. EMAIL_PORT = 25
  180. # Whether to send SMTP 'Date' header in the local time zone or in UTC.
  181. EMAIL_USE_LOCALTIME = False
  182. # Optional SMTP authentication information for EMAIL_HOST.
  183. EMAIL_HOST_USER = ""
  184. EMAIL_HOST_PASSWORD = ""
  185. EMAIL_USE_TLS = False
  186. EMAIL_USE_SSL = False
  187. EMAIL_SSL_CERTFILE = None
  188. EMAIL_SSL_KEYFILE = None
  189. EMAIL_TIMEOUT = None
  190. # List of strings representing installed apps.
  191. INSTALLED_APPS = []
  192. TEMPLATES = []
  193. # Default form rendering class.
  194. FORM_RENDERER = "django.forms.renderers.DjangoTemplates"
  195. # Default email address to use for various automated correspondence from
  196. # the site managers.
  197. DEFAULT_FROM_EMAIL = "webmaster@localhost"
  198. # Subject-line prefix for email messages send with django.core.mail.mail_admins
  199. # or ...mail_managers. Make sure to include the trailing space.
  200. EMAIL_SUBJECT_PREFIX = "[Django] "
  201. # Whether to append trailing slashes to URLs.
  202. APPEND_SLASH = True
  203. # Whether to prepend the "www." subdomain to URLs that don't have it.
  204. PREPEND_WWW = False
  205. # Override the server-derived value of SCRIPT_NAME
  206. FORCE_SCRIPT_NAME = None
  207. # List of compiled regular expression objects representing User-Agent strings
  208. # that are not allowed to visit any page, systemwide. Use this for bad
  209. # robots/crawlers. Here are a few examples:
  210. # import re
  211. # DISALLOWED_USER_AGENTS = [
  212. # re.compile(r'^NaverBot.*'),
  213. # re.compile(r'^EmailSiphon.*'),
  214. # re.compile(r'^SiteSucker.*'),
  215. # re.compile(r'^sohu-search'),
  216. # ]
  217. DISALLOWED_USER_AGENTS = []
  218. ABSOLUTE_URL_OVERRIDES = {}
  219. # List of compiled regular expression objects representing URLs that need not
  220. # be reported by BrokenLinkEmailsMiddleware. Here are a few examples:
  221. # import re
  222. # IGNORABLE_404_URLS = [
  223. # re.compile(r'^/apple-touch-icon.*\.png$'),
  224. # re.compile(r'^/favicon.ico$'),
  225. # re.compile(r'^/robots.txt$'),
  226. # re.compile(r'^/phpmyadmin/'),
  227. # re.compile(r'\.(cgi|php|pl)$'),
  228. # ]
  229. IGNORABLE_404_URLS = []
  230. # A secret key for this particular Django installation. Used in secret-key
  231. # hashing algorithms. Set this in your settings, or Django will complain
  232. # loudly.
  233. SECRET_KEY = ""
  234. # List of secret keys used to verify the validity of signatures. This allows
  235. # secret key rotation.
  236. SECRET_KEY_FALLBACKS = []
  237. # Default file storage mechanism that holds media.
  238. DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage"
  239. STORAGES = {
  240. "default": {
  241. "BACKEND": "django.core.files.storage.FileSystemStorage",
  242. },
  243. "staticfiles": {
  244. "BACKEND": "django.contrib.staticfiles.storage.StaticFilesStorage",
  245. },
  246. }
  247. # Absolute filesystem path to the directory that will hold user-uploaded files.
  248. # Example: "/var/www/example.com/media/"
  249. MEDIA_ROOT = ""
  250. # URL that handles the media served from MEDIA_ROOT.
  251. # Examples: "http://example.com/media/", "http://media.example.com/"
  252. MEDIA_URL = ""
  253. # Absolute path to the directory static files should be collected to.
  254. # Example: "/var/www/example.com/static/"
  255. STATIC_ROOT = None
  256. # URL that handles the static files served from STATIC_ROOT.
  257. # Example: "http://example.com/static/", "http://static.example.com/"
  258. STATIC_URL = None
  259. # List of upload handler classes to be applied in order.
  260. FILE_UPLOAD_HANDLERS = [
  261. "django.core.files.uploadhandler.MemoryFileUploadHandler",
  262. "django.core.files.uploadhandler.TemporaryFileUploadHandler",
  263. ]
  264. # Maximum size, in bytes, of a request before it will be streamed to the
  265. # file system instead of into memory.
  266. FILE_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB
  267. # Maximum size in bytes of request data (excluding file uploads) that will be
  268. # read before a SuspiciousOperation (RequestDataTooBig) is raised.
  269. DATA_UPLOAD_MAX_MEMORY_SIZE = 2621440 # i.e. 2.5 MB
  270. # Maximum number of GET/POST parameters that will be read before a
  271. # SuspiciousOperation (TooManyFieldsSent) is raised.
  272. DATA_UPLOAD_MAX_NUMBER_FIELDS = 1000
  273. # Maximum number of files encoded in a multipart upload that will be read
  274. # before a SuspiciousOperation (TooManyFilesSent) is raised.
  275. DATA_UPLOAD_MAX_NUMBER_FILES = 100
  276. # Directory in which upload streamed files will be temporarily saved. A value of
  277. # `None` will make Django use the operating system's default temporary directory
  278. # (i.e. "/tmp" on *nix systems).
  279. FILE_UPLOAD_TEMP_DIR = None
  280. # The numeric mode to set newly-uploaded files to. The value should be a mode
  281. # you'd pass directly to os.chmod; see
  282. # https://docs.python.org/library/os.html#files-and-directories.
  283. FILE_UPLOAD_PERMISSIONS = 0o644
  284. # The numeric mode to assign to newly-created directories, when uploading files.
  285. # The value should be a mode as you'd pass to os.chmod;
  286. # see https://docs.python.org/library/os.html#files-and-directories.
  287. FILE_UPLOAD_DIRECTORY_PERMISSIONS = None
  288. # Python module path where user will place custom format definition.
  289. # The directory where this setting is pointing should contain subdirectories
  290. # named as the locales, containing a formats.py file
  291. # (i.e. "myproject.locale" for myproject/locale/en/formats.py etc. use)
  292. FORMAT_MODULE_PATH = None
  293. # Default formatting for date objects. See all available format strings here:
  294. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  295. DATE_FORMAT = "N j, Y"
  296. # Default formatting for datetime objects. See all available format strings here:
  297. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  298. DATETIME_FORMAT = "N j, Y, P"
  299. # Default formatting for time objects. See all available format strings here:
  300. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  301. TIME_FORMAT = "P"
  302. # Default formatting for date objects when only the year and month are relevant.
  303. # See all available format strings here:
  304. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  305. YEAR_MONTH_FORMAT = "F Y"
  306. # Default formatting for date objects when only the month and day are relevant.
  307. # See all available format strings here:
  308. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  309. MONTH_DAY_FORMAT = "F j"
  310. # Default short formatting for date objects. See all available format strings here:
  311. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  312. SHORT_DATE_FORMAT = "m/d/Y"
  313. # Default short formatting for datetime objects.
  314. # See all available format strings here:
  315. # https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
  316. SHORT_DATETIME_FORMAT = "m/d/Y P"
  317. # Default formats to be used when parsing dates from input boxes, in order
  318. # See all available format string here:
  319. # https://docs.python.org/library/datetime.html#strftime-behavior
  320. # * Note that these format strings are different from the ones to display dates
  321. DATE_INPUT_FORMATS = [
  322. "%Y-%m-%d", # '2006-10-25'
  323. "%m/%d/%Y", # '10/25/2006'
  324. "%m/%d/%y", # '10/25/06'
  325. "%b %d %Y", # 'Oct 25 2006'
  326. "%b %d, %Y", # 'Oct 25, 2006'
  327. "%d %b %Y", # '25 Oct 2006'
  328. "%d %b, %Y", # '25 Oct, 2006'
  329. "%B %d %Y", # 'October 25 2006'
  330. "%B %d, %Y", # 'October 25, 2006'
  331. "%d %B %Y", # '25 October 2006'
  332. "%d %B, %Y", # '25 October, 2006'
  333. ]
  334. # Default formats to be used when parsing times from input boxes, in order
  335. # See all available format string here:
  336. # https://docs.python.org/library/datetime.html#strftime-behavior
  337. # * Note that these format strings are different from the ones to display dates
  338. TIME_INPUT_FORMATS = [
  339. "%H:%M:%S", # '14:30:59'
  340. "%H:%M:%S.%f", # '14:30:59.000200'
  341. "%H:%M", # '14:30'
  342. ]
  343. # Default formats to be used when parsing dates and times from input boxes,
  344. # in order
  345. # See all available format string here:
  346. # https://docs.python.org/library/datetime.html#strftime-behavior
  347. # * Note that these format strings are different from the ones to display dates
  348. DATETIME_INPUT_FORMATS = [
  349. "%Y-%m-%d %H:%M:%S", # '2006-10-25 14:30:59'
  350. "%Y-%m-%d %H:%M:%S.%f", # '2006-10-25 14:30:59.000200'
  351. "%Y-%m-%d %H:%M", # '2006-10-25 14:30'
  352. "%m/%d/%Y %H:%M:%S", # '10/25/2006 14:30:59'
  353. "%m/%d/%Y %H:%M:%S.%f", # '10/25/2006 14:30:59.000200'
  354. "%m/%d/%Y %H:%M", # '10/25/2006 14:30'
  355. "%m/%d/%y %H:%M:%S", # '10/25/06 14:30:59'
  356. "%m/%d/%y %H:%M:%S.%f", # '10/25/06 14:30:59.000200'
  357. "%m/%d/%y %H:%M", # '10/25/06 14:30'
  358. ]
  359. # First day of week, to be used on calendars
  360. # 0 means Sunday, 1 means Monday...
  361. FIRST_DAY_OF_WEEK = 0
  362. # Decimal separator symbol
  363. DECIMAL_SEPARATOR = "."
  364. # Boolean that sets whether to add thousand separator when formatting numbers
  365. USE_THOUSAND_SEPARATOR = False
  366. # Number of digits that will be together, when splitting them by
  367. # THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands...
  368. NUMBER_GROUPING = 0
  369. # Thousand separator symbol
  370. THOUSAND_SEPARATOR = ","
  371. # The tablespaces to use for each model when not specified otherwise.
  372. DEFAULT_TABLESPACE = ""
  373. DEFAULT_INDEX_TABLESPACE = ""
  374. # Default primary key field type.
  375. DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
  376. # Default X-Frame-Options header value
  377. X_FRAME_OPTIONS = "DENY"
  378. USE_X_FORWARDED_HOST = False
  379. USE_X_FORWARDED_PORT = False
  380. # The Python dotted path to the WSGI application that Django's internal server
  381. # (runserver) will use. If `None`, the return value of
  382. # 'django.core.wsgi.get_wsgi_application' is used, thus preserving the same
  383. # behavior as previous versions of Django. Otherwise this should point to an
  384. # actual WSGI application object.
  385. WSGI_APPLICATION = None
  386. # If your Django app is behind a proxy that sets a header to specify secure
  387. # connections, AND that proxy ensures that user-submitted headers with the
  388. # same name are ignored (so that people can't spoof it), set this value to
  389. # a tuple of (header_name, header_value). For any requests that come in with
  390. # that header/value, request.is_secure() will return True.
  391. # WARNING! Only set this if you fully understand what you're doing. Otherwise,
  392. # you may be opening yourself up to a security risk.
  393. SECURE_PROXY_SSL_HEADER = None
  394. ##############
  395. # MIDDLEWARE #
  396. ##############
  397. # List of middleware to use. Order is important; in the request phase, these
  398. # middleware will be applied in the order given, and in the response
  399. # phase the middleware will be applied in reverse order.
  400. MIDDLEWARE = []
  401. ############
  402. # SESSIONS #
  403. ############
  404. # Cache to store session data if using the cache session backend.
  405. SESSION_CACHE_ALIAS = "default"
  406. # Cookie name. This can be whatever you want.
  407. SESSION_COOKIE_NAME = "sessionid"
  408. # Age of cookie, in seconds (default: 2 weeks).
  409. SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2
  410. # A string like "example.com", or None for standard domain cookie.
  411. SESSION_COOKIE_DOMAIN = None
  412. # Whether the session cookie should be secure (https:// only).
  413. SESSION_COOKIE_SECURE = False
  414. # The path of the session cookie.
  415. SESSION_COOKIE_PATH = "/"
  416. # Whether to use the HttpOnly flag.
  417. SESSION_COOKIE_HTTPONLY = True
  418. # Whether to set the flag restricting cookie leaks on cross-site requests.
  419. # This can be 'Lax', 'Strict', 'None', or False to disable the flag.
  420. SESSION_COOKIE_SAMESITE = "Lax"
  421. # Whether to save the session data on every request.
  422. SESSION_SAVE_EVERY_REQUEST = False
  423. # Whether a user's session cookie expires when the web browser is closed.
  424. SESSION_EXPIRE_AT_BROWSER_CLOSE = False
  425. # The module to store session data
  426. SESSION_ENGINE = "django.contrib.sessions.backends.db"
  427. # Directory to store session files if using the file session module. If None,
  428. # the backend will use a sensible default.
  429. SESSION_FILE_PATH = None
  430. # class to serialize session data
  431. SESSION_SERIALIZER = "django.contrib.sessions.serializers.JSONSerializer"
  432. #########
  433. # CACHE #
  434. #########
  435. # The cache backends to use.
  436. CACHES = {
  437. "default": {
  438. "BACKEND": "django.core.cache.backends.locmem.LocMemCache",
  439. }
  440. }
  441. CACHE_MIDDLEWARE_KEY_PREFIX = ""
  442. CACHE_MIDDLEWARE_SECONDS = 600
  443. CACHE_MIDDLEWARE_ALIAS = "default"
  444. ##################
  445. # AUTHENTICATION #
  446. ##################
  447. AUTH_USER_MODEL = "auth.User"
  448. AUTHENTICATION_BACKENDS = ["django.contrib.auth.backends.ModelBackend"]
  449. LOGIN_URL = "/accounts/login/"
  450. LOGIN_REDIRECT_URL = "/accounts/profile/"
  451. LOGOUT_REDIRECT_URL = None
  452. # The number of seconds a password reset link is valid for (default: 3 days).
  453. PASSWORD_RESET_TIMEOUT = 60 * 60 * 24 * 3
  454. # the first hasher in this list is the preferred algorithm. any
  455. # password using different algorithms will be converted automatically
  456. # upon login
  457. PASSWORD_HASHERS = [
  458. "django.contrib.auth.hashers.PBKDF2PasswordHasher",
  459. "django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
  460. "django.contrib.auth.hashers.Argon2PasswordHasher",
  461. "django.contrib.auth.hashers.BCryptSHA256PasswordHasher",
  462. "django.contrib.auth.hashers.ScryptPasswordHasher",
  463. ]
  464. AUTH_PASSWORD_VALIDATORS = []
  465. ###########
  466. # SIGNING #
  467. ###########
  468. SIGNING_BACKEND = "django.core.signing.TimestampSigner"
  469. ########
  470. # CSRF #
  471. ########
  472. # Dotted path to callable to be used as view when a request is
  473. # rejected by the CSRF middleware.
  474. CSRF_FAILURE_VIEW = "django.views.csrf.csrf_failure"
  475. # Settings for CSRF cookie.
  476. CSRF_COOKIE_NAME = "csrftoken"
  477. CSRF_COOKIE_AGE = 60 * 60 * 24 * 7 * 52
  478. CSRF_COOKIE_DOMAIN = None
  479. CSRF_COOKIE_PATH = "/"
  480. CSRF_COOKIE_SECURE = False
  481. CSRF_COOKIE_HTTPONLY = False
  482. CSRF_COOKIE_SAMESITE = "Lax"
  483. CSRF_HEADER_NAME = "HTTP_X_CSRFTOKEN"
  484. CSRF_TRUSTED_ORIGINS = []
  485. CSRF_USE_SESSIONS = False
  486. # Whether to mask CSRF cookie value. It's a transitional setting helpful in
  487. # migrating multiple instance of the same project to Django 4.1+.
  488. CSRF_COOKIE_MASKED = False
  489. ############
  490. # MESSAGES #
  491. ############
  492. # Class to use as messages backend
  493. MESSAGE_STORAGE = "django.contrib.messages.storage.fallback.FallbackStorage"
  494. # Default values of MESSAGE_LEVEL and MESSAGE_TAGS are defined within
  495. # django.contrib.messages to avoid imports in this settings file.
  496. ###########
  497. # LOGGING #
  498. ###########
  499. # The callable to use to configure logging
  500. LOGGING_CONFIG = "logging.config.dictConfig"
  501. # Custom logging configuration.
  502. LOGGING = {}
  503. # Default exception reporter class used in case none has been
  504. # specifically assigned to the HttpRequest instance.
  505. DEFAULT_EXCEPTION_REPORTER = "django.views.debug.ExceptionReporter"
  506. # Default exception reporter filter class used in case none has been
  507. # specifically assigned to the HttpRequest instance.
  508. DEFAULT_EXCEPTION_REPORTER_FILTER = "django.views.debug.SafeExceptionReporterFilter"
  509. ###########
  510. # TESTING #
  511. ###########
  512. # The name of the class to use to run the test suite
  513. TEST_RUNNER = "django.test.runner.DiscoverRunner"
  514. # Apps that don't need to be serialized at test database creation time
  515. # (only apps with migrations are to start with)
  516. TEST_NON_SERIALIZED_APPS = []
  517. ############
  518. # FIXTURES #
  519. ############
  520. # The list of directories to search for fixtures
  521. FIXTURE_DIRS = []
  522. ###############
  523. # STATICFILES #
  524. ###############
  525. # A list of locations of additional static files
  526. STATICFILES_DIRS = []
  527. # The default file storage backend used during the build process
  528. STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
  529. # List of finder classes that know how to find static files in
  530. # various locations.
  531. STATICFILES_FINDERS = [
  532. "django.contrib.staticfiles.finders.FileSystemFinder",
  533. "django.contrib.staticfiles.finders.AppDirectoriesFinder",
  534. # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
  535. ]
  536. ##############
  537. # MIGRATIONS #
  538. ##############
  539. # Migration module overrides for apps, by app label.
  540. MIGRATION_MODULES = {}
  541. #################
  542. # SYSTEM CHECKS #
  543. #################
  544. # List of all issues generated by system checks that should be silenced. Light
  545. # issues like warnings, infos or debugs will not generate a message. Silencing
  546. # serious issues like errors and criticals does not result in hiding the
  547. # message, but Django will not stop you from e.g. running server.
  548. SILENCED_SYSTEM_CHECKS = []
  549. #######################
  550. # SECURITY MIDDLEWARE #
  551. #######################
  552. SECURE_CONTENT_TYPE_NOSNIFF = True
  553. SECURE_CROSS_ORIGIN_OPENER_POLICY = "same-origin"
  554. SECURE_HSTS_INCLUDE_SUBDOMAINS = False
  555. SECURE_HSTS_PRELOAD = False
  556. SECURE_HSTS_SECONDS = 0
  557. SECURE_REDIRECT_EXEMPT = []
  558. SECURE_REFERRER_POLICY = "same-origin"
  559. SECURE_SSL_HOST = None
  560. SECURE_SSL_REDIRECT = False