Skip to content
Snippets Groups Projects
Commit 5c6a90a8 authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

Make parts of SSL_CONF preconfigured

parent 16c3200c
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@ Change settings:
pikatasks.settings.BROKER = "localhost"
"""
import ssl
from datetime import timedelta
......@@ -27,8 +28,10 @@ SSL_CONF = {
# "keyfile": "/foo/client/key.pem",
# "certfile": "/foo/client/cert.pem",
# "ca_certs": "/foo/ca/cacert.pem",
# "ssl_version": ssl.PROTOCOL_TLSv1_2,
# "cert_reqs": ssl.CERT_NONE,
# NOTE: The following values are not meant to be changed through settings
# because this would be a mess in deployment!
"ssl_version": ssl.PROTOCOL_TLSv1_2,
"cert_reqs": ssl.CERT_NONE,
}
# stuff you might want to change sometimes:
......@@ -48,6 +51,10 @@ try:
if k.isupper() and not k.startswith("_"): # looks like a setting
try:
new_value = getattr(django_settings, "PIKATASKS_" + k)
if isinstance(globals()[k], dict):
assert isinstance(new_value, dict), "{} needs to be a dictionary".format(k)
globals()[k].update(new_value)
else:
globals()[k] = new_value
except ImproperlyConfigured:
pass # django is installed but not used
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment