To create a properly usable superuser, the solution right now is something like this:
echo -ne '
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
user = get_user_model().objects.create_user(username="test",password="test")
user.groups.clear()
group, created = Group.objects.get_or_create(name="default-super-group")
group.user_set.add(user)
' | docker exec -i mreg python /app/manage.py shell
Django has a python manage.py createsuperuser that people may expect to work. We can either override createsuperuser or since we already have some mreg-related commands, create a superuser command of our own and add it to the mreg section.
To create a properly usable superuser, the solution right now is something like this:
Django has a
python manage.py createsuperuser
that people may expect to work. We can either override createsuperuser or since we already have some mreg-related commands, create a superuser command of our own and add it to the mreg section.