Automatic admin users for Django projects.
pip install django-autoadmin
- Add
'autoadmin',
to your project'sINSTALLED_APPS
list. - Load the autoadmin_tags in your login template.
- Call the autoadmin_partial to display the information of the autogenerated admin user.
- Use the management command createautoadmin to create an admin user with an automatic password.
by default, django-autoadmin creates a django superuser with the username="admin"
, email="autoadmin@example.com"
and password
randomly generated.
you could modify this by creating the following variables in your settings file
AUTOADMIN_USERNAME="your_custom_username"
AUTOADMIN_EMAIL="your_custom_email"
AUTOADMIN_PASSWORD="your_custom_password"
NOTE: if AUTOADMIN_PASSWORD
is None
, the password will be randomly generated.
Autoadmin can integrate with django-allauth and authorize and promote admin users automatically. Users signing up that have their email address listed in the ADMINS
Django settings are automatically recognized.
You need to make sure django-allauth is installed. Optionally, it is possible to install it with django-autoadmin
as an extra dependency:
pip install django-autoadmin[allauth]
Django settings needed to activate this feature:
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.sites',
'allauth',
'allauth.account',
'allauth.socialaccount',
]
ACCOUNT_ADAPTER = 'autoadmin.auth.allauth.AutoadminAccountAdapter'
ADMINS = [
('Your Name', 'your.name@example.com'),
]
See also:
- http://django-allauth.readthedocs.io/en/latest/configuration.html
- http://django-allauth.readthedocs.io/en/latest/advanced.html#admin
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Make sure to add yourself to the AUTHORS file.
- Send a pull request