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.
 
 
 
 
 
 

38 lines
1.0 KiB

# coding=utf-8
import os
import django
import sys
import datetime
import os
start = datetime.datetime.now()
sys.path.append("/var/www/skillbox/")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lms.settings")
django.setup()
os.system('python check_course_map.py')
os.system('python check_prices.py')
from lms.settings import BASE_DIR
from journals.models import TeacherJ, check_journal
from lms.tools import show_progress
os.system('python clean_twice_journals.py')
all = TeacherJ.objects.filter(progress__gt=0).count()
print('Количество журналов на проверку: %s' % all)
n = 0
f = open(os.path.join(BASE_DIR, 'journals/check_switch'), 'w')
f.write('1\n')
f.close()
for i in TeacherJ.objects.filter(progress__gt=0).order_by('-id'):
check_journal(i, from_console=True)
show_progress(all, n)
n += 1
f = open(os.path.join(BASE_DIR, 'journals/check_switch'), 'w')
f.write('0\n')
f.close()
os.system('python open_lesson.py')
finish = datetime.datetime.now()
print('\nTIME: %s seconds' % (finish-start).seconds)