Debian Codegraph @

hypothesis-python/tests/django/toys/settings/settings.py

raw
1 # This file is part of Hypothesis, which may be found at
2 # https://github.com/HypothesisWorks/hypothesis/
3 #
4 # Copyright the Hypothesis Authors.
5 # Individual contributors are listed in AUTHORS.rst and the git log.
6 #
7 # This Source Code Form is subject to the terms of the Mozilla Public License,
8 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
9 # obtain one at https://mozilla.org/MPL/2.0/.
10
11 """Django settings for toys project.
12
13 For more information on this file, see
14 https://docs.djangoproject.com/en/1.7/topics/settings/
15
16 For the full list of settings and their values, see
17 https://docs.djangoproject.com/en/1.7/ref/settings/
18 """
19
20 import os
21
22 import django
23
24 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
25 BASE_DIR = os.path.dirname(os.path.dirname(__file__))
26
27
28 # Quick-start development settings - unsuitable for production
29 # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
30
31 # SECURITY WARNING: keep the secret key used in production secret!
32 SECRET_KEY = "o0zlv@74u4e3s+o0^h$+tlalh&$r(7hbx01g4^h5-3gizj%hub"
33
34 # SECURITY WARNING: don't run with debug turned on in production!
35 DEBUG = True
36
37 TEMPLATE_DEBUG = True
38
39 ALLOWED_HOSTS = []
40
41
42 # Application definition
43
44 INSTALLED_APPS = (
45 "django.contrib.admin",
46 "django.contrib.auth",
47 "django.contrib.contenttypes",
48 "django.contrib.sessions",
49 "django.contrib.messages",
50 "django.contrib.staticfiles",
51 "tests.django.toystore",
52 )
53
54 MIDDLEWARE_CLASSES = (
55 "django.contrib.sessions.middleware.SessionMiddleware",
56 "django.middleware.common.CommonMiddleware",
57 "django.middleware.csrf.CsrfViewMiddleware",
58 "django.contrib.auth.middleware.AuthenticationMiddleware",
59 "django.contrib.auth.middleware.SessionAuthenticationMiddleware",
60 "django.contrib.messages.middleware.MessageMiddleware",
61 "django.middleware.clickjacking.XFrameOptionsMiddleware",
62 )
63
64 ROOT_URLCONF = "tests.django.toys.settings.urls"
65
66 WSGI_APPLICATION = "tests.django.toys.wsgi.application"
67
68 DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
69
70
71 # Database
72 # https://docs.djangoproject.com/en/1.7/ref/settings/#databases
73
74 DATABASES = {
75 "default": {
76 "ENGINE": "django.db.backends.sqlite3",
77 "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
78 }
79 }
80
81 # Internationalization
82 # https://docs.djangoproject.com/en/1.7/topics/i18n/
83
84 LANGUAGE_CODE = "en-us"
85
86 TIME_ZONE = "UTC"
87
88 USE_I18N = True
89
90 if django.VERSION < (5, 0, 0):
91 USE_L10N = True
92
93 USE_TZ = os.environ.get("HYPOTHESIS_DJANGO_USETZ", "TRUE") == "TRUE"
94
95
96 # Static files (CSS, JavaScript, Images)
97 # https://docs.djangoproject.com/en/1.7/howto/static-files/
98
99 STATIC_URL = "/static/"
100
101
102 # Added these bits to avoid warnings on Django 2.2
103
104 TEMPLATES = [
105 {
106 "BACKEND": "django.template.backends.django.DjangoTemplates",
107 "OPTIONS": {
108 "context_processors": [
109 "django.template.context_processors.debug",
110 "django.template.context_processors.request",
111 "django.contrib.auth.context_processors.auth",
112 "django.contrib.messages.context_processors.messages",
113 ]
114 },
115 }
116 ]
117
118 MIDDLEWARE = [
119 "django.middleware.security.SecurityMiddleware",
120 "django.contrib.sessions.middleware.SessionMiddleware",
121 "django.middleware.common.CommonMiddleware",
122 "django.middleware.csrf.CsrfViewMiddleware",
123 "django.contrib.auth.middleware.AuthenticationMiddleware",
124 "django.contrib.messages.middleware.MessageMiddleware",
125 "django.middleware.clickjacking.XFrameOptionsMiddleware",
126 ]
127
128 # Transitional setting until 6.0. See
129 # https://docs.djangoproject.com/en/5.0/ref/forms/fields/#django.forms.URLField.assume_scheme
130 FORMS_URLFIELD_ASSUME_HTTPS = True