All Projects → Miserlou → Django Easy Timezones

Miserlou / Django Easy Timezones

Licence: apache-2.0
Easy timezones for Django based on GeoIP

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Easy Timezones

Django Admin Easy
Collection of admin fields and decorators to help to create computed or custom fields more friendly and easy way
Stars: ✭ 265 (+35.9%)
Mutual labels:  django, easy-to-use, easy
Tkinter-Designer
An easy and fast way to create a Python GUI 🐍
Stars: ✭ 4,697 (+2308.72%)
Mutual labels:  automatic, easy-to-use, easy
Lang-app
Add a multi lang configuration to your WEB APP 'from scratch' [ANY FRAMEWORK, ANY PLUGIN, ANY API]
Stars: ✭ 15 (-92.31%)
Mutual labels:  easy-to-use, easy
DM-BOT
📧 DM-BOT is discord bot that can record direct messages. One of us! You can also reply to those messages! DM-BOT is easy to use & understand! I decided to use Discord.js, it's literally the best.
Stars: ✭ 31 (-84.1%)
Mutual labels:  easy-to-use, easy
Easy.common
A set of useful utilities and helpers used across Easy.* projects.
Stars: ✭ 306 (+56.92%)
Mutual labels:  easy-to-use, easy
easymail
Easy way to install a mail server.
Stars: ✭ 60 (-69.23%)
Mutual labels:  easy-to-use, easy
discord.json
Discord.json | Make your own discord bot with json !
Stars: ✭ 27 (-86.15%)
Mutual labels:  easy-to-use, easy
CNN Own Dataset
CNN example for training your own datasets.
Stars: ✭ 25 (-87.18%)
Mutual labels:  easy-to-use, easy
ytmous
Anonymous Youtube Proxy
Stars: ✭ 60 (-69.23%)
Mutual labels:  easy-to-use, easy
Art
🎨 ASCII art library for Python
Stars: ✭ 1,026 (+426.15%)
Mutual labels:  easy-to-use, easy
Ezxss
ezXSS is an easy way for penetration testers and bug bounty hunters to test (blind) Cross Site Scripting.
Stars: ✭ 1,022 (+424.1%)
Mutual labels:  easy-to-use, easy
Easy.logger
A modern, high performance cross platform wrapper for Log4Net.
Stars: ✭ 118 (-39.49%)
Mutual labels:  easy-to-use, easy
CyberPunkNetrunner
Cyberpunk 2077 Netrunner Hacking Tool (Easy to use and install). Don't use it on illegal and malicious activity. Inspired by the game CyberPunk 2077 https://www.cyberpunk.net/
Stars: ✭ 69 (-64.62%)
Mutual labels:  easy-to-use, easy
AutoKeyboard
Automatic Keyboard handling for iOS written in Swift
Stars: ✭ 56 (-71.28%)
Mutual labels:  automatic, easy
rclone4pi
rclone4pi - Easy Install of rclone to Raspberry Pi Computer with automated folder sync demo
Stars: ✭ 91 (-53.33%)
Mutual labels:  automatic, easy-to-use
Seahorse
A minimal CLI framework written in Rust
Stars: ✭ 132 (-32.31%)
Mutual labels:  easy-to-use, easy
Easy.messagehub
No need for .NET Events! A thread-safe, high performance & easy to use cross platform implementation of the Event Aggregator Pattern.
Stars: ✭ 208 (+6.67%)
Mutual labels:  easy-to-use, easy
Tic Tac
Client not paid ? This is the solution of your problem
Stars: ✭ 29 (-85.13%)
Mutual labels:  easy-to-use, easy
Django Slick Reporting
Powerful and Efficient reporting engine with Charting capabilities
Stars: ✭ 123 (-36.92%)
Mutual labels:  django, easy-to-use
Easywall
Web interface for easy use of the IPTables firewall on Linux systems written in Python3.
Stars: ✭ 172 (-11.79%)
Mutual labels:  easy-to-use, easy

Timezones. Yuck.

django-easy-timezones Build Status

Easy IP-based timezones for Django (>=1.7) based on MaxMind GeoIP, with IPv6 support.

Quick start

  1. Install django-easy-timezones

    pip install django-easy-timezones
    
  2. Add "easy-timezones" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = (
      ...
      'easy_timezones',
    )
    
  3. Add EasyTimezoneMiddleware to your MIDDLEWARE_CLASSES

    MIDDLEWARE_CLASSES = (
      ...
      'easy_timezones.middleware.EasyTimezoneMiddleware',
    )
    
  4. (Optionally) Add a path to the MaxMind GeoIP cities databases (direct link because I'm nice) in your settings file:

    GEOIP_DATABASE = '/path/to/your/geoip/database/GeoLiteCity.dat'
    GEOIPV6_DATABASE = '/path/to/your/geoip/database/GeoLiteCityv6.dat'
    
  5. Enable localtime in your templates.

    {% load tz %}
        The UTC time is {{ object.date }}
    {% localtime on %}
        The local time is {{ object.date }}
    {% endlocaltime %}
    
  6. Twist one up, cause you're done, homie!

Signals

You can also use signals to perform actions based on the timezone detection.

  1. To hook into the Timezone detection event to, say, save it to the request's user somewhere more permanent than a session, do something like this:

    from easy_timezones.signals import detected_timezone	
    
    @receiver(detected_timezone, sender=MyUserModel)
    def process_timezone(sender, instance, timezone, **kwargs):
    	if instance.timezone != timezone:
        	instance.timezone = timezone
        	instance.save()
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].