Answer the question
In order to leave comments, you need to log in
How to run a script outside of django?
Hello everyone, you need to run a daemon that will use a function from the django project
from daemonize import Daemonize
from api.controllers.message import delayed_send
pid = '/backend/pid.pid'
# запуск демона
def start():
daemon = Daemonize(app='delayed_send', pid=pid, action=delayed_send)
daemon.start()
if __name__ == '__main__':
start()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question