1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 23:55:24 +00:00

DB changes

This commit is contained in:
Retspen 2015-04-02 14:24:28 +03:00
parent ea41412aac
commit 9484b11c41
4 changed files with 6 additions and 22 deletions

2
.gitignore vendored
View file

@ -2,4 +2,4 @@
.idea .idea
.DS_* .DS_*
*.pyc *.pyc
webvirtcloud.sqlite3 db.sqlite3

View file

@ -1,13 +0,0 @@
[
{
"model": "auth.user",
"pk": 1,
"fields": {
"username": "admin",
"password": "pbkdf2_sha256$15000$Qkg4dizzDzpM$SRXEyTJR5d198JZes4LVhFXlWQYJGOAjQhnfhGXQLtc=",
"is_active": true,
"is_superuser": true,
"is_staff": true
}
}
]

View file

@ -2,15 +2,12 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from django.db import migrations from django.db import migrations
from django.contrib.auth.models import User
def add_admin(apps, schema_editor): def add_useradmin(apps, schema_editor):
add_user = User.objects.create_user("admin", None, "admin") from django.contrib.auth.models import User
add_user.is_active = True # Broken in Django 1.8
add_user.is_superuser = True #User.objects.create_superuser("admin", None, "admin")
add_user.is_staff = True
add_user.save()
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -20,5 +17,5 @@ class Migration(migrations.Migration):
] ]
operations = [ operations = [
migrations.RunPython(add_admin), migrations.RunPython(add_useradmin),
] ]

Binary file not shown.