django-notifications/sample_website/settings.py

76 lines
1.9 KiB
Python
Raw Normal View History

2023-06-24 00:10:23 +00:00
""" Django notification settings for tests """
# -*- coding: utf-8 -*-
import os
2023-06-26 23:58:05 +00:00
import socket
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
2023-06-26 23:58:05 +00:00
SECRET_KEY = "secret_key" # nosec
DEBUG = True
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
}
}
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",
)
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
]
2023-06-26 23:58:05 +00:00
ROOT_URLCONF = "sample_website.urls"
2023-06-24 00:10:23 +00:00
STATIC_URL = "/static/"
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
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",
],
},
},
]
2023-06-24 00:10:23 +00:00
LOGIN_REDIRECT_URL = "test/"
LOGIN_URL = "/admin/login/"
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
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"]