-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsettings.py
133 lines (117 loc) · 3.45 KB
/
settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# This is an example test settings file for use with the Django test suite.
#
# The 'sqlite3' backend requires only the ENGINE setting (an in-
# memory database will be used). All other backends will require a
# NAME and potentially authentication information. See the
# following section in the docs for more information:
#
# https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/
#
# The different databases that Django supports behave differently in certain
# situations, so it is recommended to run the test suite against as many
# database backends as possible. You may want to create a separate settings
# file for each of the backends you test against.
import os
DEBUG = True
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'test.db',
},
}
SECRET_KEY = '__secret__'
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
USE_I18N = False
ROOT_URLCONF = 'simple_seo.urls'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': ''
}
}
INSTALLED_APPS = (
'django.contrib.staticfiles',
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.admin',
'simple_seo',
'testapp'
)
SEO_USE_CACHE = False
SEO_MODEL_REGISTRY = (
('simple_seo.TestMetadata', ('template_test', )),
)
STATIC_URL = '/static/'
STATIC_ROOT = PROJECT_PATH + STATIC_URL
MEDIA_URL = '/media/'
MEDIA_ROOT = PROJECT_PATH + MEDIA_URL
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder'
)
STATICFILES_DIRS = (
PROJECT_PATH + '/media/',
)
TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.request',
'django.core.context_processors.i18n'
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
# LOGGING CONFIGURATION WITHOUT SENTRY
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '[%(levelname)s] - (%(module)s) - %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'formatter': 'simple'
},
},
'loggers': {
'': {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
},
'django.request': {
'handlers': ['console'],
'level': 'DEBUG',
'propagate': True,
},
}
}
TEST_RUNNER = 'django_coverage.coverage_runner.CoverageRunner'
COVERAGE_BADGE_TYPE = 'drone.io'
COVERAGE_MODULE_EXCLUDES = [
'tests$', 'settings$', 'urls$', 'locale$', '__init__', 'django', 'migrations', 'templates',
'admin$', 'fixtures$', '__pycache__$'
]
COVERAGE_REPORT_HTML_OUTPUT_DIR = 'tests_html'
COVERAGE_USE_STDOUT = True
# try:
# from local_settings import *
# except ImportError:
# pass