Django Custom Language and Time Zone

Simple customization for language and timezone in django admin. By default django language is English and UTC Timezone. We can change to another language and timezone. Here’s the example, Language Bahasa Indonesia, timezone: GMT+7 (Jakarta’s Time). Official docs for Django internationalization and localization here. Focus in timezone, django use pytz library, and we can see official pytz doc here.

Default and Bahasa Indonesia Django Homepage

Step 1: Preparation, Create Django Project, Initial Migration
create virtualenv: virtualenv venv
start virtualenv: venv/Scripts/activate
install Django in virtualenv: pip install django==3.0
Create Django: django-admin startproject myproject
Go to myproject folder: cd myproject
Initial Migration: python migrate

Step 2: Create Superuser
Create superuser: python createsuperuser
Type username, email password and retype password

Step 3: Set Language and Time Zone in myproject/

Note: list of language_code here. Time zone here.

Step 4: Run Server and Testing
Run Server: python runserver

Admin Login Page
Admin Page



Software Engineer, Indonesia

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store