Background tasks in Django | How to create tasks in the background in Django - Quick & easy

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ต.ค. 2024
  • 🔥 Join the facebook group:
    / djangoninjas 🚀
    🔥 Follow pyplane on:
    ➜ instagram: / pyplaneblog
    ➜ pinterest: / pyplane
    ➜ facebook: / pyplane
    🔥 More on python and django:
    ➜ blog.pyplane.com
    Tutorial on how to create background tasks running in Django using Django crontab.
    In this video we will cover 2 cases where certain tasks will be executed in 1 minute time intervals:
    ➜ Creating simple objects to the database
    ➜ Checking if the document is valid or expired. If it's expired - the status will be changed from False (default) to True
    Link to the docs:
    ➜ pypi.org/proje...
    NOTE:
    This solution will not work on windows!
    #django #djangocrontab #learndjango #background #tasks
    background tasks in django, learn django for free, django crontab, django cron, django tutorial 2020, cron job,cron job tutorial, cron job tutorial for beginners, django cron job, django cron tutorial, django cron job example, django crontab tutorial, django cron job tutorial, cron job python, django queryset, django quick tutorial

ความคิดเห็น • 66

  • @Pyplane
    @Pyplane  4 ปีที่แล้ว +2

    Hi Guys. I'm leaving a link to a video how to backup and restore database with the use od django crontab: th-cam.com/video/s54HYoJ8wrs/w-d-xo.html

    • @MrBPLIM
      @MrBPLIM 4 ปีที่แล้ว

      Hi Pyplane, I am not sure this does not work for Python HTTP Requests.GET ?

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      @@MrBPLIM Hi. I would be suprised if it didn't, but please understand it's impossible for me to say anything else because I don't know and I don't see what you are doing. In my real time crypto app series in part 2 we used python requests and maybe in part 3 (if not part 4) we will do tasks in the background with celery. If you want you can check it out

  • @everything5240
    @everything5240 4 ปีที่แล้ว +2

    Love from India,
    I never felt anyone better than you in django

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว +1

      Glad you enjoyed the video & thanks for the nice words! :)

  • @spythere
    @spythere 2 ปีที่แล้ว +1

    Świetna robota, dokładnie tego szukałem do swojego projektu z API, dzięki :D

  • @silkogelman
    @silkogelman 2 ปีที่แล้ว

    Nice clear django-crontab example that I could apply immediately.
    Thanks for this!

  • @Brocollipy
    @Brocollipy 3 ปีที่แล้ว

    Thank you sooooo much for this. As everyone say a a really nice simple tutorial. I was struggling to find a simple solution that didn't involve running other processes. I saw this vid a while ago but stopped when you said it wasn't for windows users.. like myself. But as the site I'm working on is on an Ubuntu server I thought I'd have a go. So my advice for others using a windows machine would be to use this app for your live dev or production servers. You can test the cron function does what you want it to do using the shell. Then roll it out to your linux sever and do some trial runs.

  • @AnubhavMadhav
    @AnubhavMadhav 3 ปีที่แล้ว +2

    Great video but I gotta say bye at 0:33. ✨

  • @llewellynhattingh3496
    @llewellynhattingh3496 3 ปีที่แล้ว +2

    I followed all instructions, I am working on Linux, however it is not running.. no error code, just simply nothing is happening? Any suggestions?

  • @bumblebee2012able
    @bumblebee2012able 3 ปีที่แล้ว

    Great teacher, respect from Vietnam 🙏🙏🙏

    • @Pyplane
      @Pyplane  3 ปีที่แล้ว

      Thank you! :)

  • @romanbush5164
    @romanbush5164 2 ปีที่แล้ว +1

    Thanks you vary match !

  • @mrmuranga
    @mrmuranga 3 ปีที่แล้ว +1

    never knew of this package..thanks and well presented

    • @Pyplane
      @Pyplane  3 ปีที่แล้ว

      Thank you!

  • @dinocorry6641
    @dinocorry6641 ปีที่แล้ว

    Wow am really greatful for this. Have been going through celery alot to achieve a simple task but with this am good

    • @Pyplane
      @Pyplane  ปีที่แล้ว

      Glad you liked it 🙌

  • @ziphozenkosingwe7714
    @ziphozenkosingwe7714 4 ปีที่แล้ว

    Thank you have made me a better Django Developer. You make things in Django look simple and nice

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you! Very glad you like my videos :)

  • @liviumircea6905
    @liviumircea6905 3 ปีที่แล้ว

    Just what I need for my project...thank you

  • @webseries9482
    @webseries9482 3 ปีที่แล้ว +1

    Thanks, your chenal will grow much faster then this autotask

  • @SumitSontakke-nb6px
    @SumitSontakke-nb6px ปีที่แล้ว

    Thanks, Please make video on using django-background-tasks as well.

  • @zeecomedia
    @zeecomedia 4 ปีที่แล้ว

    thank you for the video..Simplicity is defined by all your django videos..

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you ! :))

  • @yatishsoorma2280
    @yatishsoorma2280 2 ปีที่แล้ว

    Hey man. Great video with proper explanation.

    • @Pyplane
      @Pyplane  2 ปีที่แล้ว

      Thanks! :)

  • @ahmedhashim5043
    @ahmedhashim5043 2 ปีที่แล้ว

    Thank you bud for your content , i would like ask what host service you recommend for uploading Django with crontab

  • @deepanshuaggarwal7042
    @deepanshuaggarwal7042 4 ปีที่แล้ว +1

    HI, i like your video. I have 1 doubt due we need to start cron job manually by running command or is there any way to run it automatically ?

  • @parrot785
    @parrot785 3 ปีที่แล้ว

    Very interesting. Found it accidentally, but I was wondering before how to do this kind of things :-) Many thanks!

    • @Pyplane
      @Pyplane  3 ปีที่แล้ว

      Thanks for watching! :)

  • @shalomalexander7811
    @shalomalexander7811 3 ปีที่แล้ว

    Wonderful Tutorial. Loved it. Is there any alternative for windows.

  • @aldorsan
    @aldorsan 3 ปีที่แล้ว

    Really clear tutorial

    • @Pyplane
      @Pyplane  3 ปีที่แล้ว

      Thank you!

    • @aldorsan
      @aldorsan 3 ปีที่แล้ว

      @@Pyplane How are you? y hope fine in this corona-world . I wish to ask you:
      I am facing a problem, after following your tutorial, and that is that crontab does everything as you show it, except that it does not work when I run runserver. No change is generated ... nothing. I have seen that several suffer the same problem, could you say what it could be?

  • @thing2know
    @thing2know ปีที่แล้ว

    Hi any alternative for windows users?

  • @yukselbastan4687
    @yukselbastan4687 4 ปีที่แล้ว

    again a great video, thank you.

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      thank you Yuksel ! :)

  • @saimaruthi_1
    @saimaruthi_1 4 ปีที่แล้ว

    Thank you for this tutorial, can you please suggest any alternative for Windows users

    • @saimaruthi_1
      @saimaruthi_1 3 ปีที่แล้ว

      @Gyan Guru No, I didn't research on it. But I guess there are alternatives available

  • @tusifuedison5867
    @tusifuedison5867 4 ปีที่แล้ว

    Great video, thank you

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thanks! :)

  • @mohammadshafayethaydar1652
    @mohammadshafayethaydar1652 3 ปีที่แล้ว

    Thank you so much for this tutorial. Can i send mail using crontab?

  • @QLOVEm3OFCChannel
    @QLOVEm3OFCChannel ปีที่แล้ว

    does crontab work in background without running the server ?

  • @_CS_DeepMehta
    @_CS_DeepMehta 4 ปีที่แล้ว

    Amazing boss 💪💪

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      Thank you! :)

  • @rangabharath4253
    @rangabharath4253 4 ปีที่แล้ว

    awesome

  • @nehat786
    @nehat786 3 ปีที่แล้ว

    I dont know why my code is not working at all and no error I am getting. The code seems fine. . I am using Django 3.2 please help me out if anyone countering t he same

  • @briansilvestri707
    @briansilvestri707 3 ปีที่แล้ว

    Does this work in production for any OS?

  • @_falcon01
    @_falcon01 3 ปีที่แล้ว

    This just does not work for me for some reason. I am doing this on a mac and I have followed every single step one by one and it doesn't work. Anyone have any tips?

  • @lejonjaro7695
    @lejonjaro7695 3 ปีที่แล้ว

    I using windows 10. I just import my files using FTP to my rpi 3

  • @MrBPLIM
    @MrBPLIM 4 ปีที่แล้ว

    Can you this work in AWS EC2 ?

  • @aadilkp5335
    @aadilkp5335 3 ปีที่แล้ว

    why doesn't it work on windows?

  • @furiousangel256
    @furiousangel256 2 ปีที่แล้ว

    its not support windows :(

  • @erdem.demirci
    @erdem.demirci 4 ปีที่แล้ว

    Firstly, thanks. What about Celery for background tasks ?

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว +3

      Hi Erdem. Thanks for the comment. I finally have and idea that I actually like on a celery tutorial! So it's coming up very soon. Just have to reorganize priorities on my video list :)

    • @erdem.demirci
      @erdem.demirci 4 ปีที่แล้ว

      Pyplane Nice to hear that, FOLLOWING !!! 👍

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      @@erdem.demirci Awesome. Thank you! :)

  • @shutianwang5799
    @shutianwang5799 2 ปีที่แล้ว

    rip not work for windows

  • @helluci6449
    @helluci6449 2 ปีที่แล้ว

    Why r u on the side tho

  • @antonionavarro7478
    @antonionavarro7478 4 ปีที่แล้ว

    Does it work on Django 3? I’m not able to make it work on Django 3.0.5

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      yes, it works if you are on mac (as mentioned in the intro)

    • @antonionavarro7478
      @antonionavarro7478 4 ปีที่แล้ว

      @@Pyplane Problem was that, as my project has different settings files, it is necessary to add “CRONTAB_DJANGO_SETTINGS_MODULE = yourapp.settings.settingfile” to the settings base file, above CRONJOBS

    • @Pyplane
      @Pyplane  4 ปีที่แล้ว

      @@antonionavarro7478 happy you figured it out.Cheers!

  • @brianssendagire262
    @brianssendagire262 3 ปีที่แล้ว

    This is a excellent tutorial, but it won't work on windows

    • @Pyplane
      @Pyplane  3 ปีที่แล้ว

      yes, I mentioned that in the intro