2023-06-24 00:10:23 +00:00
|
|
|
""" Django notification settings for tests """
|
2018-05-31 04:05:44 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2015-12-12 07:09:20 +00:00
|
|
|
import os
|
2023-06-26 23:58:05 +00:00
|
|
|
import socket
|
2018-05-31 04:05:44 +00:00
|
|
|
|
2015-12-12 07:09:20 +00:00
|
|
|
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
|
2023-06-26 23:58:05 +00:00
|
|
|
SECRET_KEY = "secret_key" # nosec
|
2015-03-28 08:25:56 +00:00
|
|
|
|
2015-12-12 07:09:20 +00:00
|
|
|
DEBUG = True
|
2015-03-28 08:25:56 +00:00
|
|
|
TESTING = True
|
|
|
|
|
|
|
|
|
|
DATABASES = {
|
2023-06-24 00:10:23 +00:00
|
|
|
"default": {
|
|
|
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
|
|
|
"NAME": "test.sqlite3",
|
2015-12-11 13:32:20 +00:00
|
|
|
}
|
2015-03-28 08:25:56 +00:00
|
|
|
}
|
|
|
|
|
|
2023-06-22 23:42:40 +00:00
|
|
|
MIDDLEWARE = (
|
2023-06-26 23:58:05 +00:00
|
|
|
"debug_toolbar.middleware.DebugToolbarMiddleware",
|
2023-06-24 00:10:23 +00:00
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
2015-04-09 04:36:15 +00:00
|
|
|
)
|
2015-03-28 08:25:56 +00:00
|
|
|
|
2020-04-08 21:40:02 +00:00
|
|
|
INSTALLED_APPS = [
|
2023-06-24 00:10:23 +00:00
|
|
|
"django.contrib.admin",
|
|
|
|
|
"django.contrib.auth",
|
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
|
"django.contrib.messages",
|
|
|
|
|
"django.contrib.staticfiles",
|
|
|
|
|
"django.contrib.sessions",
|
2023-06-26 23:58:05 +00:00
|
|
|
"debug_toolbar",
|
|
|
|
|
# As "external" lib
|
2023-06-24 00:10:23 +00:00
|
|
|
"notifications",
|
2023-06-26 23:58:05 +00:00
|
|
|
# The sample app
|
|
|
|
|
"sample_app",
|
2020-04-08 21:40:02 +00:00
|
|
|
]
|
2015-03-28 08:25:56 +00:00
|
|
|
|
2023-06-26 23:58:05 +00:00
|
|
|
ROOT_URLCONF = "sample_website.urls"
|
2023-06-24 00:10:23 +00:00
|
|
|
STATIC_URL = "/static/"
|
2015-12-12 07:09:20 +00:00
|
|
|
STATICFILES_DIRS = [
|
|
|
|
|
os.path.join(BASE_DIR, "static"),
|
|
|
|
|
]
|
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "static-files")
|
2015-03-29 06:37:27 +00:00
|
|
|
|
2015-12-10 02:50:03 +00:00
|
|
|
TEMPLATES = [
|
|
|
|
|
{
|
2023-06-24 00:10:23 +00:00
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
2023-06-26 23:58:05 +00:00
|
|
|
"DIRS": [os.path.join(BASE_DIR, "templates")],
|
|
|
|
|
"APP_DIRS": True,
|
2023-06-24 00:10:23 +00:00
|
|
|
"OPTIONS": {
|
|
|
|
|
"context_processors": [
|
|
|
|
|
"django.template.context_processors.debug",
|
|
|
|
|
"django.template.context_processors.request",
|
|
|
|
|
"django.contrib.auth.context_processors.auth",
|
|
|
|
|
"django.contrib.messages.context_processors.messages",
|
2015-12-10 02:50:03 +00:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
|
2023-06-24 00:10:23 +00:00
|
|
|
LOGIN_REDIRECT_URL = "test/"
|
|
|
|
|
LOGIN_URL = "/admin/login/"
|
2018-05-30 04:11:40 +00:00
|
|
|
APPEND_SLASH = True
|
2018-05-30 05:18:33 +00:00
|
|
|
|
2018-05-30 05:21:16 +00:00
|
|
|
DJANGO_NOTIFICATIONS_CONFIG = {
|
2023-06-24 00:10:23 +00:00
|
|
|
"USE_JSONFIELD": True,
|
2018-05-30 05:18:33 +00:00
|
|
|
}
|
2018-06-08 02:02:35 +00:00
|
|
|
USE_TZ = True
|
2020-04-08 21:40:02 +00:00
|
|
|
|
2023-06-22 23:42:40 +00:00
|
|
|
ALLOWED_HOSTS = ["*"]
|
2023-06-26 23:58:05 +00:00
|
|
|
|
|
|
|
|
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
|
|
|
|
|
INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + ["127.0.0.1", "10.0.2.2"]
|