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


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-fullname-localization, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size django-fullname-localization-0.1.0.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page