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 hashes)

Uploaded Source

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