You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jumpserver/utils/export_init_data.sh

22 lines
379 B

8 years ago
#!/bin/bash
#
python ../apps/manage.py shell << EOF
8 years ago
from users.models import *
init_model()
8 years ago
from assets.models import *
init_model()
from audits.models import LoginLog
LoginLog.objects.all().delete()
8 years ago
EOF
python ../apps/manage.py dbshell << EOF
8 years ago
delete from django_content_type;
delete from auth_permission;
EOF
python ../apps/manage.py dumpdata > ../apps/fixtures/init.json