M
M
Maxim2017-03-13 13:01:48
Django
Maxim, 2017-03-13 13:01:48

Why does the stream not start from all files?

Hello!
Here there is such structure
ca46e450f2114a879592745d09e627dd.png
In message.py at start of a jung the stream starts without problems.
Added stream to stats/views.py but doesn't want to run.
I created an api file in the root of the folder, it does not start. With api/views.py started.
Code Example

def s():
    while True:
        print('SSSSSSSSSS')
        time.sleep(5)


t = threading.Thread(target=s, daemon=True)
t.start()

In fact, this principle works in message.py, but it does not want to in stats.
Although when I import the contents of stats/views.py via manage.py shell, it starts.
In settings, the stats application has been added accordingly.
Tell me what's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2017-03-13
@sim3x

Tell me what's wrong?

def s():
    while True:
        print('SSSSSSSSSS')
        time.sleep(5)


t = threading.Thread(target=s, daemon=True)
t.start()

Why does the stream not start from all files?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question