django 初始化数据库
刷新数据库
guoguos-MacBook-Pro:mysite guoguo$ python manage.py sqlflush
BEGIN;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE `auth_user`;
TRUNCATE `auth_group`;
TRUNCATE `auth_user_user_permissions`;
TRUNCATE `django_content_type`;
TRUNCATE `auth_group_permissions`;
TRUNCATE `django_session`;
TRUNCATE `django_admin_log`;
TRUNCATE `auth_user_groups`;
TRUNCATE `auth_permission`;
SET FOREIGN_KEY_CHECKS = 1;
COMMIT;
清空数据库的数据
guoguos-MacBook-Pro:mysite guoguo$ python manage.py flush
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the ‘django‘ database,
and return each table to an empty state.
Are you sure you want to do this?
Type ‘yes