Django L10N extensions adds some useful L10N extensions to the Django framework
The project in maintained on github
To create a new distribution from this package follow these steps:
- create new virualenv met python 3
mkvirtualenv -p /usr/bin/python3 django-l10n-extensions
- install requirements
pip install -r setup/requirements.txt
- update the version in
./setup.py
, otherwise you will overwrite an already existing version. - Make a new distribution run:
python setup.py sdist bdist_wheel
- Optional upload to pypi TEST:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
to upload to PRODUCTION you need a token to upload to https://pypi.org/ read https://pypi.org/help/#apitoken
CONCEPT version
Always work in UTC and use date / datetime aware instances
e.g. python 3 datetime.utcfromtimestamp(0).timestamp() --> -3600 # datetime instance has no timezone and python fallback on OS timezone
datetime.utcnow() is also timezone unaware use datetime.utc(tz=timezone.utc)
datetime.strptime("1970-0101T00:00:00", "%Y-%m-%dT%H:%M:%S) is also timezone unaware use datetime.strptime("1970-0101T00:00:00", "%Y-%m-%dT%H:%M:%S).replace(tzinfo=timezone.utc)