Advertisement
Guest User

Untitled

a guest
Apr 9th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. # Generated by Django 2.0.13 on 2019-04-09 14:25
  2.  
  3. from django.db import migrations
  4. from django.contrib.auth import get_user_model
  5.  
  6. def add_root_user(apps, schema_editor):
  7.     user = apps.get_model("users","User").objects.create_superuser(username='root', id=0, email="root@example.com", password="blablabla")
  8.     print(apps.get_model("users","User"))
  9.  
  10. class Migration(migrations.Migration):
  11.  
  12.     dependencies = [
  13.         ('enanghub', '0001_initial'),
  14.     ]
  15.  
  16.     operations = [
  17.         migrations.RunPython(add_root_user),
  18.     ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement