Skip to main content

Add localization support for user's fullname.

Project description

django-fullname-localization

Add localization support for user's fullname.

Install

pip install django-fullname-localization

Settings

pro/settings.py

INSTALLED_APPS = [
    ...
    'django_fullname_localization',
    ...
]

Fullname template setting

FULL_NAME_TEMPLATE default to "{last_name}{first_name}", it's chinese default name format ^_^. Supported paramters are:

  • user
  • last_name
  • fisrt_name

If using default User model, you can user first_name and last_name parameter to write your own template. If using customer model that has more name parts, you can using parameter {user.your_own_field}.

Usage

app/template/demo.html

{{request.user.get_full_name}}

app/views.py

def page(request):
    ...
    fullname = request.user.get_fullname()
    ...

Release

v0.1.0 2020/02/29

  • First release.

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-fullname-localization-0.1.0.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file django-fullname-localization-0.1.0.tar.gz.

File metadata

  • Download URL: django-fullname-localization-0.1.0.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.5

File hashes

Hashes for django-fullname-localization-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c73139f01fbad7942e9e31fc552ad741c30dd74bb728c0bac632150e19b64702
MD5 8354467f2e2c0fe89958b6ef80a4c9c6
BLAKE2b-256 1637d75c84715c74ad1d52ec4000ee8725cbb48c03de2d208f4cd4d326166dfd

See more details on using hashes here.

Supported by

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