Skip to main content

Django IP2Location Timezone

Django IP2Location Timezone is a Django package that can help you easily display your website visitor the time according to their location. This package used IP2Location Web Service to get time zone information.

Requirements

  1. Python 2.7 and above.
  2. Django 1.11 and above.
  3. IP2Location Web Service API Key. You can get a trial API key from IP2Location.

Quick Start

  1. Install this package by using PYPI:

    pip install django-ip2location-timezone
    
  2. Add "ip2location_timezone" to your INSTALLED_APPS setting in settings.py:

    INSTALLED_APPS = (
      ...
      'ip2location_timezone',
    )
    
  3. Add "IP2locationTimezoneMiddleware" to your MIDDLEWARE_CLASSES in settings.py:

    MIDDLEWARE_CLASSES = (
      ...
      'ip2location_timezone.middleware.IP2locationTimezoneMiddleware',
    )
    
  4. Add your IP2Location Web Service API Key in settings.py:

    IP2LOCATION_API_KEY = 'YOUR_API_KEY'
    
  5. In your template, add the following code to display the user time zone and current time:

    {% load tz %}
    {% localtime on %}
    	{% get_current_timezone as TIME_ZONE %}
    	Your timezone is {{ TIME_ZONE }}.<br/><br/>
    	It is {% now "DATETIME_FORMAT" %}
    {% endlocaltime %}
    

Support

Email: support@ip2location.com.

URL: https://www.ip2location.com

Metadata

Release files for django-ip2location-timezone 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ip2location-timezone 1.0.0
File Size Uploaded
django-ip2location-timezone-1.0.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-ip2location-timezone 1.0.0
File Interpreter ABI Platform
django_ip2location_timezone-1.0.0-py2-none-any.whl Python 2 none any Details

Total release size: 8.8 kB

Release files / django-ip2location-timezone-1.0.0.tar.gz

Download URL django-ip2location-timezone-1.0.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a9c90128356f7d3fc55ae45126d28d6f5c95abb8e39d0f83c4ed20e936720212
BLAKE2b-256 checksum
How to use checksums
a59d0730f1d5587ed82f598d304751083d97fe1fac7f6f7624e192a3862e6ccb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

Release files / django_ip2location_timezone-1.0.0-py2-none-any.whl

Download URL django_ip2location_timezone-1.0.0-py2-none-any.whl
Size 4.9 kB
Tags Python 2
SHA-256 checksum
How to use checksums
082bc9b1c1abf5756573d3928939a1b0a79dba02861c6d74d092e2bbb019ed50
BLAKE2b-256 checksum
How to use checksums
82015e243f400cbbe27e1c1a5fb31fc61c66ec9f5c424683ec4f2de359c0580c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page