Skip to content

Commit ad861f7

Browse files
authored
Merge pull request #184 from asherf/lint
more cleanup of settings file for the end 2 end test app.
2 parents 1d1f48c + d8a0d33 commit ad861f7

File tree

1 file changed

+11
-42
lines changed

1 file changed

+11
-42
lines changed

django_prometheus/tests/end2end/testapp/settings.py

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,13 @@
11
import os
22
import tempfile
33

4-
# Quick-start development settings - unsuitable for production
5-
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
6-
74
# SECURITY WARNING: keep the secret key used in production secret!
85
SECRET_KEY = ")0-t%mc5y1^fn8e7i**^^v166@5iu(&-2%9#kxud0&4ap#k!_k"
9-
10-
# SECURITY WARNING: don't run with debug turned on in production!
11-
#
12-
# BIGGER SECURITY WARNING: if you're trying to disable DEBUG, you're
13-
# probably trying to run the testapp in production. DO NOT RUN THE
14-
# TESTAPP IN PRODUCTION. It contains several features that are
15-
# horrible hacks or even intentional security holes, to facilitate
16-
# automated or manual testing (like /sql which lets you, or anyone,
17-
# execute arbitrary SQL queries). DO NOT RUN THE TESTAPP IN
18-
# PRODUCTION.
196
DEBUG = True
20-
217
ALLOWED_HOSTS = []
228

239

2410
# Application definition
25-
2611
INSTALLED_APPS = (
2712
"django.contrib.admin",
2813
"django.contrib.auth",
@@ -35,22 +20,17 @@
3520
)
3621

3722

38-
def GetMiddlewareClasses():
39-
classes = [
40-
"django_prometheus.middleware.PrometheusBeforeMiddleware",
41-
"django.contrib.sessions.middleware.SessionMiddleware",
42-
"django.middleware.common.CommonMiddleware",
43-
"django.middleware.csrf.CsrfViewMiddleware",
44-
"django.contrib.auth.middleware.AuthenticationMiddleware",
45-
"django.contrib.messages.middleware.MessageMiddleware",
46-
"django.middleware.clickjacking.XFrameOptionsMiddleware",
47-
"django.middleware.security.SecurityMiddleware",
48-
"django_prometheus.middleware.PrometheusAfterMiddleware",
49-
]
50-
return classes
51-
52-
53-
MIDDLEWARE = GetMiddlewareClasses()
23+
MIDDLEWARE = [
24+
"django_prometheus.middleware.PrometheusBeforeMiddleware",
25+
"django.contrib.sessions.middleware.SessionMiddleware",
26+
"django.middleware.common.CommonMiddleware",
27+
"django.middleware.csrf.CsrfViewMiddleware",
28+
"django.contrib.auth.middleware.AuthenticationMiddleware",
29+
"django.contrib.messages.middleware.MessageMiddleware",
30+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
31+
"django.middleware.security.SecurityMiddleware",
32+
"django_prometheus.middleware.PrometheusAfterMiddleware",
33+
]
5434

5535
ROOT_URLCONF = "testapp.urls"
5636

@@ -73,9 +53,6 @@ def GetMiddlewareClasses():
7353
WSGI_APPLICATION = "testapp.wsgi.application"
7454

7555

76-
# Database
77-
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
78-
7956
DATABASES = {
8057
"default": {
8158
"ENGINE": "django_prometheus.db.backends.sqlite3",
@@ -147,22 +124,14 @@ def GetMiddlewareClasses():
147124
}
148125

149126
# Internationalization
150-
# https://docs.djangoproject.com/en/1.8/topics/i18n/
151-
152127
LANGUAGE_CODE = "en-us"
153-
154128
TIME_ZONE = "UTC"
155-
156129
USE_I18N = True
157-
158130
USE_L10N = True
159-
160131
USE_TZ = True
161132

162133

163134
# Static files (CSS, JavaScript, Images)
164-
# https://docs.djangoproject.com/en/1.8/howto/static-files/
165-
166135
STATIC_URL = "/static/"
167136

168137
LOGGING = {

0 commit comments

Comments
 (0)