Add one click installer scripts/autoinstall.sh
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
from django.core.management.base import BaseCommand, CommandError
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
class Command(BaseCommand):
|
||||
user_name = "admin"
|
||||
password = "password123"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
u = User(username=self.user_name)
|
||||
u.set_password(self.password)
|
||||
u.is_superuser = True
|
||||
u.is_staff = True
|
||||
u.save()
|
||||
|
||||
self.stdout.write("Created default user {} with password {}.")
|
||||
Reference in New Issue
Block a user