Repository navigation
How do I give myself administrator permission? (Local instance) #4654
|
Since I am using a third party authentication method (MediaWiki), the ADMIN environment variable does not work and will prevent me from logging in. ./manage.py also does not seem to have some kind of command to give someone permission |
Replies: 1 comment 6 replies
|
Admin in Pontoon is just Django's Log in once through MediaWiki so your account exists, then open a shell in the server container ( ./manage.py shell -c "from django.contrib.auth.models import User; print(User.objects.filter(email='you@example.com').update(is_superuser=True, is_staff=True))"Use the email your MediaWiki account logs in with. It should print ( |
Admin in Pontoon is just Django's
is_superuserflag on your user, so you can set it directly from the Django shell.Log in once through MediaWiki so your account exists, then open a shell in the server container (
make shellif you're using the Docker setup) and run:./manage.py shell -c "from django.contrib.auth.models import User; print(User.objects.filter(email='you@example.com').update(is_superuser=True, is_staff=True))"Use the email your MediaWiki account logs in with. It should print
1;0means no user has that email yet (check withUser.objects.values_list('email', flat=True)). Log out and back in afterwards.(
./manage.py createsuperuserdoes exist, since it's Django's built-in that…