-
Notifications
You must be signed in to change notification settings - Fork 0
/
product.py
66 lines (54 loc) · 1.9 KB
/
product.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
# Django settings for product env.
import os
from django.core.exceptions import ImproperlyConfigured
from tcms.settings.common import * # noqa
environ = os.environ
# Debug settings
DEBUG = False
TEMPLATE_DEBUG = DEBUG
DATABASES = {
"default": {
"ENGINE": SUPPORTED_DB_ENGINES[DB_ENGINE],
"NAME": environ.get("NITRATE_DB_NAME", "nitrate"),
"USER": environ.get("NITRATE_DB_USER", "nitrate"),
"PASSWORD": environ.get("NITRATE_DB_PASSWORD", "nitrate"),
"HOST": environ.get("NITRATE_DB_HOST", ""),
"PORT": environ.get("NITRATE_DB_PORT", ""),
},
}
SECRET_KEY = os.environ.get("NITRATE_SECRET_KEY", "")
if not SECRET_KEY:
raise ImproperlyConfigured(
"Environment variable NITRATE_SECRET_KEY must be set to provide a "
"unique secret key to the Django's SECRET_KEY"
)
AUTHENTICATION_BACKENDS = ("django.contrib.auth.backends.ModelBackend",)
STATIC_ROOT = "/project/static/"
TEMPLATES[0].update({"DIRS": ["/project/templates"]})
# Set the default send mail address
EMAIL_HOST = "smtp.example.com"
EMAIL_FROM = "[email protected]"
# Site-specific messages
# added for nitrate3.4 compatibility
DEFAULT_GROUPS = ["default"]
# You can add a help link on the footer of home page as following format:
# ('http://foo.com', 'foo')
FOOTER_LINKS = (
("https://nitrate.readthedocs.io/en/latest/api/xmlrpc.html", "XML-RPC Service"),
("https://nitrate.readthedocs.io/en/latest/guide.html", "User Guide"),
)
# admin settings
ADMINS = (
# ('Your Name', '[email protected]'),
)
try:
from nitrate_custom_conf import *
except ModuleNotFoundError:
import sys
print("No custom config module is importable.", file=sys.stderr)
print(
"If the custom config module is expected to be importable, "
"please check whether the directory containing the module is added "
"to the PYTHONPATH already.",
file=sys.stderr,
)