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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file createadmin-1.0.tar.gz.
File metadata
- Download URL: createadmin-1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6519531ab9d6c80f89d41d2f12a26550358e92a63916636ceb20b866745c672
|
|
| MD5 |
0967552033ed26b4a84975216b8962e0
|
|
| BLAKE2b-256 |
d1ece28ebc47198c6130e34611e67de7a323e745773ac419420481572fad6b79
|
File details
Details for the file createadmin-1.0-py3-none-any.whl.
File metadata
- Download URL: createadmin-1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a83e034a97e87179c859418ce6607c3be0b2317afc0dbbeb92f18577c04bf76b
|
|
| MD5 |
9bd6eaf72661cec9535c661d7c49151f
|
|
| BLAKE2b-256 |
0b3fd19eac1380e2e7091f5106f4926deb96dc3eaf90d6c5927868863c980fc6
|