| 1 |
""" |
| 2 |
Django settings for testing Django-Mailman. |
| 3 |
|
| 4 |
For more information on this file, see |
| 5 |
https://docs.djangoproject.com/en/1.8/topics/settings/ |
| 6 |
|
| 7 |
For the full list of settings and their values, see |
| 8 |
https://docs.djangoproject.com/en/1.8/ref/settings/ |
| 9 |
""" |
| 10 |
|
| 11 |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
| 12 |
import os |
| 13 |
|
| 14 |
|
| 15 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 16 |
|
| 17 |
TESTING = True |
| 18 |
|
| 19 |
# Quick-start development settings - unsuitable for production |
| 20 |
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ |
| 21 |
|
| 22 |
# SECURITY WARNING: keep the secret key used in production secret! |
| 23 |
SECRET_KEY = 'change-this-on-your-production-server' |
| 24 |
|
| 25 |
# SECURITY WARNING: don't run with debug turned on in production! |
| 26 |
DEBUG = False |
| 27 |
|
| 28 |
ADMINS = () |
| 29 |
|
| 30 |
# Hosts/domain names that are valid for this site; required if DEBUG is False |
| 31 |
# See https://docs.djangoproject.com/en/1.8/ref/settings/#allowed-hosts |
| 32 |
ALLOWED_HOSTS = [] |
| 33 |
|
| 34 |
SITE_ID = 1 |
| 35 |
|
| 36 |
# Mailman API credentials |
| 37 |
MAILMAN_REST_API_URL = 'http://localhost:8001' |
| 38 |
MAILMAN_REST_API_USER = 'restadmin' |
| 39 |
MAILMAN_REST_API_PASS = 'restpass' |
| 40 |
|
| 41 |
# Application definition |
| 42 |
|
| 43 |
INSTALLED_APPS = ( |
| 44 |
'django.contrib.admin', |
| 45 |
'django.contrib.auth', |
| 46 |
'django.contrib.contenttypes', |
| 47 |
'django.contrib.sessions', |
| 48 |
'django.contrib.sites', |
| 49 |
'django.contrib.messages', |
| 50 |
'django.contrib.staticfiles', |
| 51 |
'django.contrib.humanize', |
| 52 |
'django_mailman3', |
| 53 |
'allauth', |
| 54 |
'allauth.account', |
| 55 |
'allauth.socialaccount', |
| 56 |
'allauth.socialaccount.providers.openid', |
| 57 |
'django_gravatar' |
| 58 |
) |
| 59 |
|
| 60 |
|
| 61 |
MIDDLEWARE = ( |
| 62 |
'allauth.account.middleware.AccountMiddleware', |
| 63 |
'django.middleware.security.SecurityMiddleware', |
| 64 |
'django.contrib.sessions.middleware.SessionMiddleware', |
| 65 |
'django.middleware.common.CommonMiddleware', |
| 66 |
'django.middleware.csrf.CsrfViewMiddleware', |
| 67 |
'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 68 |
'django.contrib.messages.middleware.MessageMiddleware', |
| 69 |
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 70 |
) |
| 71 |
|
| 72 |
|
| 73 |
ROOT_URLCONF = 'django_mailman3.tests.urls_test' |
| 74 |
|
| 75 |
TEMPLATES = [ |
| 76 |
{ |
| 77 |
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 78 |
'DIRS': [], |
| 79 |
'APP_DIRS': True, |
| 80 |
'OPTIONS': { |
| 81 |
'context_processors': [ |
| 82 |
'django.template.context_processors.debug', |
| 83 |
'django.template.context_processors.i18n', |
| 84 |
'django.template.context_processors.media', |
| 85 |
'django.template.context_processors.static', |
| 86 |
'django.template.context_processors.tz', |
| 87 |
'django.template.context_processors.request', |
| 88 |
'django.contrib.auth.context_processors.auth', |
| 89 |
'django.contrib.messages.context_processors.messages', |
| 90 |
], |
| 91 |
}, |
| 92 |
}, |
| 93 |
] |
| 94 |
|
| 95 |
# WSGI_APPLICATION = 'django_mailman3.example_project.wsgi.application' |
| 96 |
|
| 97 |
|
| 98 |
# Database |
| 99 |
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases |
| 100 |
|
| 101 |
DATABASES = { |
| 102 |
'default': { |
| 103 |
'ENGINE': 'django.db.backends.sqlite3', |
| 104 |
'NAME': '/dummy/django_mailman3.db', |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 108 |
# Maintain type of autogenerated keys going forward |
| 109 |
# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys |
| 110 |
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' |
| 111 |
|
| 112 |
# Internationalization |
| 113 |
# https://docs.djangoproject.com/en/1.8/topics/i18n/ |
| 114 |
|
| 115 |
LANGUAGE_CODE = 'en-us' |
| 116 |
|
| 117 |
TIME_ZONE = 'UTC' |
| 118 |
|
| 119 |
USE_I18N = True |
| 120 |
|
| 121 |
USE_TZ = True |
| 122 |
|
| 123 |
|
| 124 |
# Static files (CSS, JavaScript, Images) |
| 125 |
# https://docs.djangoproject.com/en/1.8/howto/static-files/ |
| 126 |
|
| 127 |
|
| 128 |
# Absolute path to the directory static files should be collected to. |
| 129 |
# Don't put anything in this directory yourself; store your static files |
| 130 |
# in apps' "static/" subdirectories and in STATICFILES_DIRS. |
| 131 |
# Example: "/var/www/example.com/static/" |
| 132 |
# STATIC_ROOT = '' |
| 133 |
STATIC_ROOT = BASE_DIR + '/static/' |
| 134 |
|
| 135 |
# URL prefix for static files. |
| 136 |
# Example: "http://example.com/static/", "http://static.example.com/" |
| 137 |
STATIC_URL = '/static/' |
| 138 |
|
| 139 |
# Additional locations of static files |
| 140 |
STATICFILES_DIRS = ( |
| 141 |
# Put strings here, like "/home/html/static" or "C:/www/django/static". |
| 142 |
# Always use forward slashes, even on Windows. |
| 143 |
# Don't forget to use absolute paths, not relative paths. |
| 144 |
# BASE_DIR + '/static/', |
| 145 |
) |
| 146 |
|
| 147 |
|
| 148 |
# A sample logging configuration. The only tangible logging |
| 149 |
# performed by this configuration is to send an email to |
| 150 |
# the site admins on every HTTP 500 error when DEBUG=False. |
| 151 |
# See http://docs.djangoproject.com/en/dev/topics/logging for |
| 152 |
# more details on how to customize your logging configuration. |
| 153 |
LOGGING = { |
| 154 |
'version': 1, |
| 155 |
'disable_existing_loggers': False, |
| 156 |
'handlers': { |
| 157 |
'console': { |
| 158 |
'class': 'logging.StreamHandler', |
| 159 |
'formatter': 'verbose', |
| 160 |
}, |
| 161 |
}, |
| 162 |
'loggers': { |
| 163 |
'django': { |
| 164 |
'handlers': ['console'], |
| 165 |
'level': 'INFO', |
| 166 |
'propagate': True, |
| 167 |
}, |
| 168 |
'django_mailman3': { |
| 169 |
'handlers': ['console'], |
| 170 |
'level': 'DEBUG', |
| 171 |
'propagate': True, |
| 172 |
}, |
| 173 |
}, |
| 174 |
'formatters': { |
| 175 |
'verbose': { |
| 176 |
'format': '%(levelname)s %(asctime)s %(module)s: %(message)s' |
| 177 |
}, |
| 178 |
}, |
| 179 |
'root': { |
| 180 |
'handlers': ['console'], |
| 181 |
'level': 'INFO', |
| 182 |
}, |
| 183 |
} |
| 184 |
|
| 185 |
|
| 186 |
# Use SSL when logged in. You need to enable the SSLRedirect middleware for |
| 187 |
# this feature to work. |
| 188 |
# USE_SSL = True |
| 189 |
|
| 190 |
# Enable caching to make sure the unit tests run when it's on. |
| 191 |
CACHES = { |
| 192 |
'default': { |
| 193 |
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', |
| 194 |
} |
| 195 |
} |