mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
DB changes
This commit is contained in:
parent
ea41412aac
commit
9484b11c41
4 changed files with 6 additions and 22 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -2,4 +2,4 @@
|
|||
.idea
|
||||
.DS_*
|
||||
*.pyc
|
||||
webvirtcloud.sqlite3
|
||||
db.sqlite3
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
]
|
|
@ -2,15 +2,12 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
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()
|
||||
def add_useradmin(apps, schema_editor):
|
||||
from django.contrib.auth.models import User
|
||||
# Broken in Django 1.8
|
||||
#User.objects.create_superuser("admin", None, "admin")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
@ -20,5 +17,5 @@ class Migration(migrations.Migration):
|
|||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(add_admin),
|
||||
migrations.RunPython(add_useradmin),
|
||||
]
|
||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Loading…
Reference in a new issue