Skip to main content

Abstract countdown timer model to use in your Django projects.

Project description


The goal of this library is to allow you to inherit an abstract model in your model and turn it into a countdown time with pause and resume capability.

Simply import, inherit and your model is now a timer without worrying about the complexity involved in timekeeping.

This library is written to return the countdown value based on timestamps and thus does not require complicated background tick processes.

Minimum Requirements

  • Python 3.7
  • Django 3.0.7


Run the following in your project.

pip install django-countdowntimer-model

In your settings.p file please add:

    # ...
    # ...


First you must import the abstraction into your model file.

from countdowntimer_model.models import CountdownTimer

Afterwords your model must inherit the abstraction.

class DoomsdayCountdownTimer(CountdownTimer):
    # ...

When you create your model, it is essential you set the duration_in_minutes and state fields. Afterwords the model will handle the rest. Please note if you want to override to use a custom timezone then you can set the timezone_override field.

doomsday_timer = DoomsdayCountdownTimer.object.create(

Now that the object has been created you can get the latest countdown by running the following:

remaining_t = doomsday_timer.remaining_time() # // Returned in `time` format.


remaining_minutes = doomsday_timer.remaining_time_in_minutes() # // Returned in `integer` format.


This library is licensed under the BSD 2-Clause License. See LICENSE for more information.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-countdowntimer-model, version 0.0.7
Filename, size File type Python version Upload date Hashes
Filename, size django_countdowntimer_model-0.0.7-py3-none-any.whl (10.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-countdowntimer-model-0.0.7.tar.gz (11.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page