Set up a scheduled job?

后端 未结 24 2548
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 01:13

I\'ve been working on a web app using Django, and I\'m curious if there is a way to schedule a job to run periodically.

Basically I just want to run through the dat

24条回答
  •  误落风尘
    2020-11-22 01:55

    after the part of code,I can write anything just like my views.py :)

    #######################################
    import os,sys
    sys.path.append('/home/administrator/development/store')
    os.environ['DJANGO_SETTINGS_MODULE']='store.settings'
    from django.core.management impor setup_environ
    from store import settings
    setup_environ(settings)
    #######################################
    

    from http://www.cotellese.net/2007/09/27/running-external-scripts-against-django-models/

提交回复
热议问题