Skip to main content

Create Default Admin Credentials in Django Admin.

Project description

Create Django Admin Default Credentials

The createadmin package provides a Django management command, createadmin, that facilitates the creation of superuser default login credentials for the Django Admin Interface. This command is useful for setting up initial access to the admin interface during project development, packaging & deployment.

Installation

To install the package, use the following pip command:

pip install createadmin

After installation, add ‘createadmin’ to the INSTALLED_APPS list in your project’s settings.py file:

INSTALLED_APPS = [
    # ...
    'createadmin',
    # ...
]

Usage

### Default Credentials

To create a superuser with the default credentials (username: admin, password: admin, email: admin@example.com), run the following command in the terminal:

python manage.py createadmin

### Custom Credentials

You can also create a superuser with custom credentials by adding a dictionary block to your project’s settings.py file:

# settings.py

CREATE_ADMIN = {
    'username': 'your_custom_username',
    'password': 'your_custom_password',
    'email': 'your_custom_email@example.com',
}

Then, run the following command in the terminal:

python manage.py createadmin

Note: Ensure that the ‘createadmin’ app is included in your INSTALLED_APPS list before running the command.

Example

Here’s an example of using custom credentials in the settings.py file:

# settings.py

INSTALLED_APPS = [
    # ...
    'createadmin',
    # ...
]

CREATE_ADMIN = {
    'username': 'yash',
    'password': 'yash',
    'email': 'ychaudhari124@gmail.com',
}

Run the following command in the terminal:

python manage.py createadmin

This will create a superuser with the specified custom credentials.

Note: It is recommended to change the default or custom credentials once the initial setup is complete for security reasons.

This package simplifies the process of creating Django Admin default credentials, making it more efficient for project setup, development, packaging & deployment.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

createadmin-1.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

createadmin-1.0-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page