Спасибо за советы, но мне нужно было просто
while True засунуть в отдельный поток
не хотел возится с разными контейнерами и тд
сделал вот так, не знаю как это правильно или нет, но работает
def main():
while 1:
for i in Profiles.objects.all():
current = time.time()
current = str(current).split(".")[0]
period_time = int(i.unix_date) + (int(i.period) * 60) * 60
if period_time < int(current):
period(start_profil=i)
current = time.time()
current = str(current).split(".")[0]
Profiles.objects.filter(name=i).update(unix_date=int(current))
time.sleep(1000)
a = Thread(target=main)
a.start()