Socket
Socket
Sign inDemoInstall

django-ip2location-timezone

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    django-ip2location-timezone

Django IP2Location Timezone is a simple Django package that can help you easily display your website visitor the time according to their location.


Maintainers
1

Readme

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

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc