Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
django-sage-timezone
Advanced tools
Django Sage Timezone Management is a Django package that allows administrators to easily select and apply a timezone for their session directly from the Django Admin interface. Once set, the timezone is automatically applied to all datetime displays during the session.
pytz
.pip
with virtualenv
Create a Virtual Environment:
python -m venv .venv
Activate the Virtual Environment:
On Windows:
.venv\Scripts\activate
On macOS/Linux:
source .venv/bin/activate
Install django-sage-timezone
:
pip install django-sage-timezone
poetry
Initialize Poetry (if not already initialized):
poetry init
Install django-sage-timezone
:
poetry add django-sage-timezone
Apply Migrations:
After installation, ensure to run the following commands to apply necessary migrations:
python manage.py makemigrations
python manage.py migrate
Add django-sage-timezone
to your INSTALLED_APPS
in the Django settings:
INSTALLED_APPS = [
...
"sage_timezone",
"django.contrib.admin"
]
Also, add the TimezoneMiddleware
to your middleware settings:
MIDDLEWARE = [
"django.contrib.sessions.middleware.SessionMiddleware",
"sage_timezone.middleware.TimezoneMiddleware",
...
]
The sage_timezone.middleware.timezone.TimezoneMiddleware
must be placed after the django.contrib.sessions.middleware.SessionMiddleware
in your MIDDLEWARE
setting. This order is crucial to ensure that the session data is available when the timezone is set.
You can set a custom session name in your Django settings using the TIME_ZONE_SESSION_NAME
setting. For example:
TIME_ZONE_SESSION_NAME = 'your_custom_session_name'
Once configured, the Django Admin will include a "Select Timezone" option in the navigation bar. Administrators can choose their preferred timezone, which will be applied to their session.
FAQs
A project for timezone handling.
We found that django-sage-timezone demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.