django-sundial
Django application providing database, form fields and middleware for timezone support.
Installation
pip install django-sundial
Usage
# settings.py
TIME_ZONE = 'America/Chicago'
AUTH_USER_MODEL = 'app.User'
MIDDLEWARE = [
...,
'django.contrib.sessions.middleware.SessionMiddleware',
...,
'sundial.middleware.TimezoneMiddleware',
...,
]
# app/models.py
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.signals import user_logged_in
from django.dispatch.dispatcher import receiver
from sundial.fields import TimezoneField
from sundial.utils import set_session_timezone
from sundial.zones import COMMON_GROUPED_CHOICES
class User(AbstractUser):
timezone = TimezoneField(
default=settings.TIME_ZONE, choices=COMMON_GROUPED_CHOICES
)
@receiver(user_logged_in)
def assign_user_timezone(request, user, **kwargs):
set_session_timezone(request.session, user.timezone)
Metadata
Release files for django-sundial 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-sundial-1.1.1.tar.gz | 4.8 kB | Without provenance | Details for django-sundial-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_sundial-1.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for django_sundial-1.1.1-py2.py3-none-any.whl |
Total release size: 10.9 kB
Release files / django-sundial-1.1.1.tar.gz
| Download URL | django-sundial-1.1.1.tar.gz |
|---|---|
| Size | 4.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18859f56cb4b0b1992854cd1fce8cdb6fb5381949fbda675f27faa46557e44cc
|
|
BLAKE2b-256 checksum How to use checksums |
610e859d56a82dc6c4d33f02b2b8fd0dacfdd7c5b953c9c0bc00b114fffb5c76
|
| 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
|
Release files / django_sundial-1.1.1-py2.py3-none-any.whl
| Download URL | django_sundial-1.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9e624f487a7416b2592c94db052683492059cd7f8455a0fcf62891186bf8e804
|
|
BLAKE2b-256 checksum How to use checksums |
620c32a19277179b52593654ace27c8a9e3dd646789a326b6decaf10cb8aaf92
|
| 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.6.9
|
Security for django-sundial 1.1.1
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.