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.5.0.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setuseragent-0.5.0.tar.gz.
File metadata
- Download URL: setuseragent-0.5.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
897903756ba3e8771b135fd854b09ab299764213c0f807b22eb518ba1ca4ed99
|
|
| MD5 |
d3ef79328cd490b750415c23def34c14
|
|
| BLAKE2b-256 |
b27d4538e4b8aa6af563613c75ab61a93ee391ba31d5fa81e1fc96a5be7e4db3
|
File details
Details for the file setuseragent-0.5.0-py3-none-any.whl.
File metadata
- Download URL: setuseragent-0.5.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebdf456d6ff47cab8b9812448204cea9bc15de70a174ad2f5d13554ca0a0feb0
|
|
| MD5 |
c25546e1da1f610360a905aa7efd6dec
|
|
| BLAKE2b-256 |
98e20c943e6e38106adee67eeb4845f15a0dd25148585961fe89221d1233b90a
|