Fix unused admin credentials in .env file

This commit is contained in:
Keannu Bernasol 2024-09-01 16:47:33 +08:00
parent b879266907
commit 12b8ed02fd
2 changed files with 3 additions and 6 deletions

View file

@ -5,14 +5,11 @@ SECRET_KEY = ''
# Production Switches # Production Switches
BACKEND_DEBUG = 'True' BACKEND_DEBUG = 'True'
# Superuser Credentials
DJANGO_ADMIN_USERNAME = 'admin'
DJANGO_ADMIN_EMAIL = 'admin@drf-template.com'
DJANGO_ADMIN_PASSWORD = ''
# Seed Data Credentials # Seed Data Credentials
# Username and emails can be found in seed_data.json
SEED_DATA = 'True' SEED_DATA = 'True'
SEED_DATA_PASSWORD = '12345' SEED_DATA_PASSWORD = '12345'
SEED_DATA_ADMIN_PASSWORD = ''
# Email Credentials # Email Credentials
EMAIL_HOST = 'inbucket' EMAIL_HOST = 'inbucket'

View file

@ -21,7 +21,7 @@ def create_users(sender, **kwargs):
if user['password'] == 'USE_REGULAR': if user['password'] == 'USE_REGULAR':
password = get_secret('SEED_DATA_PASSWORD') password = get_secret('SEED_DATA_PASSWORD')
elif user['password'] == 'USE_ADMIN': elif user['password'] == 'USE_ADMIN':
password = get_secret('DJANGO_ADMIN_PASSWORD') password = get_secret('SEED_DATA_ADMIN_PASSWORD')
else: else:
password = user['password'] password = user['password']
if (user['is_superuser'] == True): if (user['is_superuser'] == True):