1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-13 00:45:17 +00:00
webvirtcloud/accounts/migrations/0002_auto_20150325_0846.py

25 lines
530 B
Python
Raw Normal View History

2015-03-25 09:36:37 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
2015-03-27 15:12:15 +00:00
from django.db import migrations
2015-03-25 09:36:37 +00:00
from django.contrib.auth.models import User
2015-03-27 15:12:15 +00:00
2015-03-25 09:36:37 +00:00
def add_admin(apps, schema_editor):
add_user = User.objects.create_user("admin", None, "admin")
add_user.is_active = True
add_user.is_superuser = True
add_user.is_staff = True
add_user.save()
2015-03-27 15:12:15 +00:00
2015-03-25 09:36:37 +00:00
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.RunPython(add_admin),
2015-03-27 15:12:15 +00:00
]