0

I am creating a web application in django and I want to create a backend app which runs continuously instead of running only when the "view" is called. How do I do this ?

Any help would be appreciated.

Thank you.

Kiran
  • 20,167
  • 11
  • 67
  • 99
Pankaj Bhambhani
  • 659
  • 3
  • 12
  • 20

4 Answers4

1

http://code.google.com/p/django-cron/

This is a plugin, which will allow you to put some tasks for independent execution.

Also this question contains good solution for this question: Django - Set Up A Scheduled Job?

Community
  • 1
  • 1
Vestel
  • 1,005
  • 1
  • 11
  • 25
1

Have a look at Celery. It is a task queue that tightly integrates with Django.

You can also create a custom management command that contains a while True: ... sleep loop.

In any case, you should set DEBUG to false, otherwise Django will eat up your memory.

Daniel Hepper
  • 28,981
  • 10
  • 72
  • 75
0

Django is not especially for this; that said, you can use django's facilities, and just write a programme that executes continuously.

Marcin
  • 48,559
  • 18
  • 128
  • 201
0

Write a management command and daemonize it with supervisord.

By the way, technically django itself is running continuously and not only when view is called.

What are you trying to acheive?

Mikhail Korobov
  • 21,908
  • 8
  • 73
  • 65