Django-Crontab - Collecting Data with Scheduled Functions in Django

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 26

  • @FuturaInteligencia
    @FuturaInteligencia 9 месяцев назад

    Very useful video, it explained and demoed exactly what I needed to accomplish. Thank you!

    • @bugbytes3923
      @bugbytes3923  9 месяцев назад

      Thanks a lot! Glad to hear it helped!

  • @DelioC
    @DelioC 2 года назад +4

    great video. I would like to suggest making a video integrating django-components with htmx. I think those two packages would pair up really nice.

    • @bugbytes3923
      @bugbytes3923  2 года назад +1

      Thank you - that sounds interesting. I had a quick look at django-components, looks good! I'll research this suggestion further, soon. Thanks again.

  • @tazul8
    @tazul8 Год назад +1

    Thank you for making useful video.

  • @imbesrs
    @imbesrs 2 года назад +2

    holy fuck. you have a video on everything. One of my projects im building i needed to run a background task every x minutes to fetch api data from twitch and i have been struggling all day to figure out how to smoothly execute a background tasks repeatedly. Thank you!!!

    • @bugbytes3923
      @bugbytes3923  2 года назад +1

      Hahaha thank you!
      There's loads of topics I'd like to cover that I've not had time to do yet - so not everything ... yet ;)
      I'm glad this one was useful!

  • @bitpilot79
    @bitpilot79 2 года назад +1

    Really nice!

  • @alexwilliams5895
    @alexwilliams5895 2 года назад +1

    Nice video! Thanks for creating it.

  • @AndresNavarro-im8nq
    @AndresNavarro-im8nq Год назад +1

    It is giving me an error with the environment variables, when the task is executed it does not detect them

  • @dodokwak
    @dodokwak 2 года назад +1

    Thanks. I've tried to create cron jobs with django-extentions but with a little success. Could you please make a video how to setup cron jobs that way.

    • @bugbytes3923
      @bugbytes3923  2 года назад +1

      Hi - thanks for the suggestion, I'll maybe make a short video on this soon.

  • @manleyg4907
    @manleyg4907 Год назад +1

    Should there be concern on using django-crontab as it has not been updated in over 4 years? Also, if the server this is running on gets rebooted, do I need to re-run the con tab add command or will it fire up on its own?

    • @bugbytes3923
      @bugbytes3923  Год назад +1

      For your first point - you raise a good question. I would say that it doesn't look good for django-crontab, unfortunately. It's probably best avoided in new Django apps going forward.
      There seems to be a better maintained package for the same task here: github.com/tivix/django-cron
      For your second question, after you add the Django cronjobs with the 'add' command, it should persist in the system's crontab. So no need to re-run when the server reboots.

    • @AndresNavarro-im8nq
      @AndresNavarro-im8nq Год назад

      @@bugbytes3923 @ErrorBytes can i schedule a task to run daily(django-cron)

    • @bugbytes3923
      @bugbytes3923  Год назад

      @@AndresNavarro-im8nq Hi Andres - for sure, you can do that!

  • @MadaMediaproduction
    @MadaMediaproduction 2 года назад

    Nice video ! Is there is anyidea why it dont work on schedule after i deploy on railway

  • @electroe2143
    @electroe2143 2 года назад

    great video ! But i have a issue with CMD "service cron start" in Dockerfile , it won't start cron when built but if I manually run the start cron command in container, it works.

    • @bugbytes3923
      @bugbytes3923  2 года назад +1

      Thank you! Are you starting the cron service as part of the run command, *along* with the Django runserver command? For example in my Dockerfile, the CMD is:
      CMD service cron start && python manage.py runserver 0.0.0.0:8000
      You need to run these together, as part of the command. Are you already doing this?

    • @electroe2143
      @electroe2143 2 года назад

      @@bugbytes3923 I use nginx with gunicorn.
      in my Dockerfile:
      CMD ["gunicorn", "--config", "gunicorn-cfg.py", "core.wsgi"]

    • @AndresNavarro-im8nq
      @AndresNavarro-im8nq Год назад

      @@electroe2143 how did you solve it?

  • @defidelity
    @defidelity 2 года назад +2

    Can't work on windows 😭

    • @dodokwak
      @dodokwak 2 года назад +1

      Agree, such a pain with that wsl2!