jumpserver/utils/export_init_data.sh

22 lines
388 B
Bash
Raw Normal View History

2016-11-25 14:45:47 +00:00
#!/bin/bash
#
2017-03-26 03:50:09 +00:00
python2.7 ../apps/manage.py shell << EOF
2016-11-25 14:45:47 +00:00
from users.models import *
2017-04-04 03:37:52 +00:00
init_model()
2016-11-25 14:45:47 +00:00
from assets.models import *
2017-04-04 03:37:52 +00:00
init_model()
from audits.models import LoginLog
LoginLog.objects.all().delete()
2016-11-25 14:45:47 +00:00
EOF
2017-03-26 03:50:09 +00:00
python2.7 ../apps/manage.py dbshell << EOF
2016-11-25 14:45:47 +00:00
delete from django_content_type;
delete from auth_permission;
EOF
2017-03-26 03:50:09 +00:00
python2.7 ../apps/manage.py dumpdata > ../apps/fixtures/init.json