File: createSuperUserIfNone

package info (click to toggle)
slm 2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,504 kB
  • sloc: python: 15,349; javascript: 5,043; makefile: 184; sh: 182; xml: 57
file content (4 lines) | stat: -rw-r--r-- 196 bytes parent folder | download | duplicates (2)
1
2
3
4
from django.contrib.auth.models import User
superusers = User.objects.filter(is_superuser=True)
if not superusers:
    User.objects.create_superuser('admin', '__ADMIN_E_MAIL__', '__ADMIN_PASS__')