Add one click installer scripts/autoinstall.sh

This commit is contained in:
Jan Tuomi
2017-03-03 02:02:40 +02:00
parent bf9aad4f4c
commit 307ddbdca6
11 changed files with 300 additions and 2 deletions
View File
@@ -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 {}.")