Self-hostable blog for developers built on Wagtail and Django, with webpack, Bootstrap, and CodeMirror.
blogbootstrapdjangodockerhandcodedpythonself-hostedwagtailwebpack
1from django.db import migrations
2
3
4def create_superuser(apps, schema_editor):
5 """
6 Makes the initial admin superuser with the username admin and the password
7 admin.
8 """
9 User = apps.get_model('accounts', 'User')
10 user = User.objects.create_superuser(username='admin', password='admin')
11 user.first_name = 'Admin'
12 user.last_name = 'User'
13 user.email = '[email protected]'
14 user.save()
15
16
17class Migration(migrations.Migration):
18
19 dependencies = [
20 ('accounts', '0001_initial'),
21 ]
22
23 operations = [
24 migrations.RunPython(create_superuser),
25 ]