Adding SuperUser Permission to admin

38 views
Skip to first unread message

Harish SS

unread,
Dec 24, 2021, 1:30:24 AM12/24/21
to OpenWISP
Hi All,

I disabled the admin SuperUser permission by mistake,can you please tell me the steps to give superuser permission to admin in command line.



Thank you

Ajay Tripathi

unread,
Dec 24, 2021, 10:12:53 AM12/24/21
to OpenWISP
Hi,

To give superuser permission to the existing user:

1. Go to ```/opt/openwisp```
2. Find `manage.py` file.
3. Find python environment. (I think it must be called `venv` or `env`)
4. Run `source venv/bin/activate`
5. Run `python manage.py shell`
6. Run ```
from django.contrib.auth.models import User


user = User.objects.get(username="myname")
user.is_staff = True
 
user.is_superuser = True
user.is_admin = True
user.save()
```
 --- --- --- --- --- --- --- ---

Create a new superuser:

1. Go to `/opt/openwisp`
2. Find `manage.py` file.
3. Find python environment. (I think it must be called `venv` or `env`)
4. Run `source venv/bin/activate`
5. Run `python manage.py createsuperuser`


Cheers,
Ajay Tripathi

Harish SS

unread,
Dec 28, 2021, 1:01:03 AM12/28/21
to OpenWISP
Hi,

Thank you for the support.

Reply all
Reply to author
Forward
0 new messages