def db_reinit(email='*****@*****.**'): u"""Пересоздать БД, накатить миграции, создать суперпользователя""" if _ask('Вы уверены что хотите пересоздать БД {db_name}?'.format(**env), exit_if_no=True): # здесь нельзя юникод _truncate_db() call_command('migrate') _message_ok('Enter superuser {email} password', email=email) call_command('createsuperuser', email=email, noinput=1) _message_ok('Current {db_name} database purged', db_name=env.db_name)
def pygments_css(schema='colorful'): if schema=='list': from pygments.styles import get_all_styles _message_ok('Avalible styles: {}'.format(', '.join(list(get_all_styles())))) else: local("pygmentize -f html -S {schema} -a .codehilite > {static_root}/css/pygments.css".format( static_root=django_settings.STATIC_ROOT, schema=schema, ))