# Generated by Django 2.1.5 on 2019-01-18 11:18

from django.db import migrations
from django.conf import settings
from django.contrib.auth.hashers import make_password


def create_user(app, shema_editor):
    User = app.get_model(app_label='auth', model_name='User')
    admin_user = User()
    admin_user.password = make_password(settings.SUPER_USER_PASSWORD)
    admin_user.username = settings.SUPER_USER_NAME
    admin_user.is_superuser = True
    admin_user.is_staff = True
    admin_user.save()


class Migration(migrations.Migration):
    dependencies = [
        ('presents', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(create_user)
    ]
