Skip to main content

Django middleware for when you want your fonts to get freaky.

Project description

Freaky Funky Fonts Middleware (Django)

For when you feel the funk that freaks you fonts

What it this?

Freaky Funky Fonts Middleware is essentially a Django “font chaos” middleware package with configurable behaviour.

It intercespts the html of Djangos reponses

Usage

  • Install the package
  • Apply the middleare in your Django project settings as middleare
  • (Optional but recommended) Configure in your freakyfunkyfonts.toml (or .ini for versions before python 3.11)

Installing

pip install django-freakyfunkyfonts

Applying

In the project settings

MIDDLEWARE = [
    # ...
    "freakyfunkyfonts.middleware.FreakyFunkyFontsMiddleware",
]

Configs

Example:

[fonts]
# List of fonts to cycle through
pool = [
  "Times New Roman",
  "Georgia",
  "Merriweather",
  "Lora"
]

[inject]
# Extra tags to inject into <head> (Like a link tag to google fonts)
# More than one tag can be applied, just append to the list
# Make sure that the fonts in the pool are convered
tags = [
  '<link href="https://fonts.googleapis.com/css2?family=Merriweather&family=Lora&display=swap" rel="stylesheet">'
]

[behaviour]
# Scopes to operate on: "all" (If it should work on the whole html document), "body", or any tag names (article, main)
scopes = ["body", "article", "main"]

# HTML tags to skip completely
skip_tags = ['head', 'title', 'meta', 'link', 'style', 'script'] 

[date_ranges]
# List of date ranges with optional time ranges
include = [
  { range = "2025-10-01:2025-10-10", temporal = ["08:00-18:00"] },
  { range = "2025-12-24:2025-12-26", temporal = ["00:00-23:59"] }
]
exclude = [
  { range = "2025-12-31:2026-01-01", temporal = ["00:00-23:59"] }
]

# The middleware will only apply during the included date/time ranges, and will be skipped during excluded ranges.
# If no temporal is specified, the range applies for the whole day.
# If no ranges are defined, the middleware is always applied

Dev

Installing

pip install -e .

Project details


Download files

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

Source Distribution

django_freakyfunkyfonts-1.2.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_freakyfunkyfonts-1.2.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file django_freakyfunkyfonts-1.2.2.tar.gz.

File metadata

  • Download URL: django_freakyfunkyfonts-1.2.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for django_freakyfunkyfonts-1.2.2.tar.gz
Algorithm Hash digest
SHA256 fef2a8ccebfda0f2c47c68c9ce37807c674e38a7e87719559987caaf675b0f47
MD5 8bbe762074b7ca2e793d1e3dbb0fbdaf
BLAKE2b-256 51b93e41cd408c552afa53e01a565506df4d5c039e73703ec7e1d987c7cc49d2

See more details on using hashes here.

File details

Details for the file django_freakyfunkyfonts-1.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_freakyfunkyfonts-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 29c42fd8fbd9c08f0f4169fe21a12c1dcb641ba456814985f2b2be153bf9db19
MD5 59d6e2de8ce05a53f5662ad6c464cff1
BLAKE2b-256 7a3ea62bcbbf2d9bcc2206525f122b839cb06525a3e230ac11dc488c932291b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page