Skip to main content

Monkey patches for setting user-agent header.

Project description

Monkey patches for setting user-agent header.

# Importing hooks automatically handles monkey patching
from setuseragent import hooks
# We can set to a specific value
hooks.set_user_agent("my-new-user-agent")
# Or we can set it with a package version
hooks.set_distribution('my-package')
# or using meta package name
hooks.set_distribution(__package__)

If using Django, can optionally set the site name as part of the package

# in settings.py

INSTALLED_APPS = [
    ...,
    "setuseragent.django",
    "django.contrib.sites",
]

# Optionally can configure a specific package to lookup.
# otherwise defaults to the value of DJANGO_SETTINGS_MODULE
USER_AGENT_DISTRIBUTION = __package__

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

setuseragent-0.7.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

setuseragent-0.7.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file setuseragent-0.7.0.tar.gz.

File metadata

  • Download URL: setuseragent-0.7.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for setuseragent-0.7.0.tar.gz
Algorithm Hash digest
SHA256 26facbf78cf149381c519b6d29cff6cb359a60b7648c9f085721a2895de64494
MD5 e7180c19b93cef2ef19253f5ee1834af
BLAKE2b-256 9b44109fedce11e897f214b0d586cac6d6e77378105b452a39da1dcc25619f71

See more details on using hashes here.

File details

Details for the file setuseragent-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: setuseragent-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for setuseragent-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 336096abfce523762ba9b9b593a0684cf807825440fd76b3bd31e068c13fdcb7
MD5 41b51626b5f4011e129455dfe4a6586b
BLAKE2b-256 15d60aefe28f79519c32901fc71c39edd02c0fce44b4d5db5d01207581e64ed5

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