Skip to main content

Tip of the Day (totd)

A Django application that allows you to create tips or hints to be displayed at the top of specific pages on your website. This app allows you to define tips in the Django Admin, assign them to specific pages, and give a date range in which they should be displayed.

Installation

Install the Django Tip of the Day package:

pip install django-totd

Settings

Totd requires the Django Sites application.

Add django.contrib.sites and totd to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django.contrib.sites'
    `totd',
]

Add the tips Context Processor:

TEMPLATES = [
    {
        "BACKEND": "django.template.backends.django.DjangoTemplates",
        "DIRS": [],
        "APP_DIRS": True,
        "OPTIONS": {
            "context_processors": [
                ...
                "totd.context_processors.tips",
            ]
        },
    }
]

Templates

Totd works a lot like the Django Messages framework, you should add it to the top of the content portion of your base template so that it can be used in any page extending that template. The URL path of the request will be used to decide which Tip to show.

Add the following snippet to your base template:

{% if tip %}
<div class="alerts">
    <div class="alert {{ tip.tags }}"><strong>{% trans "Tip:" %} </strong>{{ tip.text|safe }}</div>
</div>
{% endif %}

Metadata

Release files for django-totd 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-totd 1.0.2
File Size Uploaded Provenance
django-totd-1.0.2.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-totd 1.0.2
File Interpreter ABI Platform
django_totd-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.7 kB

Release files / django-totd-1.0.2.tar.gz

Download URL django-totd-1.0.2.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
da3b40b83166823a28c7ab7dbca2a7fdb516b96521bf8d78b26ffffb8b24c503
BLAKE2b-256 checksum
How to use checksums
560529a42f162a37fb55f222e8ebb5b743e405d91a99dbaefbcecc5193f75929
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6

Release files / django_totd-1.0.2-py3-none-any.whl

Download URL django_totd-1.0.2-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
676d1ad822e215742ef49237ac24b3344e5914661e0a352ff35b6fb66d3d03c0
BLAKE2b-256 checksum
How to use checksums
b1732fa3d909e2f6e77532632fcf770c166d682833f1e995312f355439be7719
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.6

Security for django-totd 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page