OpenSlides/server/openslides/saml/management/commands/create-saml-settings.py
FinnStutzenstein 2bcab5d098
Repository restructure
- moved all server related things into the folder `server`, so this
configuration is parallel to the client.
- All main "services" are now folders in the root directory
- Added Dockerfiles to each service (currently server and client)
- Added a docker compose configuration to start everything together.
Currently there are heavy dependencies into https://github.com/OpenSlides/openslides-docker-compose
- Resturctured the .gitignore. If someone needs something excluded,
please add it to the right section.
- Added initial build setup with Docker and docker-compose.
- removed setup.py. We won't deliver OpenSlides via pip anymore.
2020-08-21 08:11:13 +02:00

34 lines
969 B
Python

import os
from django.core.management.base import BaseCommand
from ...settings import create_saml_settings, get_settings_dir_and_path
class Command(BaseCommand):
"""
Command to create the saml_settings.json file.
"""
help = "Create the saml_settings.json settings file."
def add_arguments(self, parser):
parser.add_argument(
"-d",
"--dir",
default=None,
help="Directory for the saml_settings.json file.",
)
def handle(self, *args, **options):
settings_dir = options.get("dir")
if settings_dir is not None:
settings_path = os.path.join(settings_dir, "saml_settings.json")
if not os.path.isdir(settings_path):
print(f"The directory '{settings_dir}' does not exist. Aborting...")
return
else:
_, settings_path = get_settings_dir_and_path()
create_saml_settings(settings_path)