/django-autoadmin

Automatic admin users for Django projects. Mirror of GitLab repo -->

Primary LanguagePythonMIT LicenseMIT

Django Autoadmin Latest version

Build status Code health Python versions Wheel support Software license

Description

Automatic admin users for Django projects.

Screenshot

Installation

Simple Setup

pip install django-autoadmin
  • Add 'autoadmin', to your project's INSTALLED_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.

Social-Auth Setup

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:

Contribute

  • 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