Saravanan666/pypi-org huggingface dataset:
Package: django-ses-feedback
Simple app to add bounce records to the database. It allows for a helper
to check and see if an email should be delivered to a recipient or not.Modelsdjango_ses_feedback.models.EmailAddressNotificationHelpersdjango_ses_feedback.helpers.can_send_emailSettings``` SESFEEDBACK = { ‘MAXCOUNT’: 2, ‘PROCESS*BOUNCE’: True,
‘PROCESS*COMPLAINT’: True, }```NotesThis was taken from AnyHow code base for use with other applications.
AnyHow itself doesn’t use this because of other model requirements but a
general application should be able to use this just fine.
Package: django-ses-gateway
django-ses-gateway’s documentation:Introduction:Django ses gatewayis used for sending mails from your verified domains and verifed emails with less cost. We can also use django-ses-gateway for receive messages and deliver them to an Amazon S3 bucket in an enctypted format, call your custom code via an AWS Lambda function, or publish notifications to Amazon SNS to process the response.Installation ProcedureInstall django-ses-gateway using the following command:pip install django-ses-gateway

            (or)

git clone git://github.com/micropyramid/django-ses-gateway.git

cd django-ses-gateway

python setup.py installAfter installing/cloning this, add the following details in settings file to send/receive emails notifications# AWS details

AWS_ACCESS_KEY_ID = "Your AWS Access Key"

AWS_SECRET_ACCESS_KEY = "Your AWS Secret Key"Usage:Sending an email:sending_mail(subject, email_template_name, context, from_email, to_email)Receiving an email:from django_ses_gateway.receiving_mail import sns_notification
subject, from_mail, to_mail, hash_code, mail_content = sns_notification(request.body)It will process the your message content, will return the email subject, from mail, to email(abc@yourdomain.com), hashcode(abc), mail content.We welcome your feedback and support, raisegithub ticketif you want to report a bug. Need new features?Contact us here
Package: django-ses-plus
Django SES PlusDjango module to store and send email with AWS SES. It's an extension fordjango-sespackage.ReleasesYou can see the releaseshere.Installationpip installdjango-ses-plus.Adddjango_ses_plusto theINSTALLED_APPSin the settings file.Set up Django SES Plus email backend.EMAIL_BACKEND = 'django_ses_plus.backends.SESPlusBackend'Please refer to django-ses packagedocumentationfor detailed configuration of AWS SES.Configure settings.DJANGO_SES_PLUS_SETTINGS = {
    "SEND_EMAIL": True,  # True by default.
    "CELERY_TASK_RETRY_KWARGS": {
        'max_retries': 15, 
        'countdown': 60
    }
}python manage.py migrate(Optional) AddSendEmailMixinto your auth user model.from django_ses_plus.models import SendEmailMixin

class AuthUser(SendEmailMixin,...):
    ....
    
user.send_email(subject, template_path, context, from_email=None, language=None)
# OR
from django_ses_plus.tasks import send_email
send_email.delay(subject, to_email, html_message, from_email=None, message=None, recipient_id=None)SupportPleaseopen an issuefor support.ContributingPlease contribute usingGithub Flow. Create a branch, add commits, andopen a pull request.
Package: django-session-activity
List all active sessions and sign-out from all sessions opened on other computers.Developed aten.ig.ma software shop.OverviewThis app records and shows last session activity and allows users to
sign-out from all active sessions, even remote ones.In other words, it handles the following use case:You come back home and realize that you forgot to
log out on your work/university/other remote computer. What now?You take a look at the recent active sessions for your account
and click a single button to deactivate all sessions
opened on other computers.DocumentationThe full documentation is athttp://django-session-activity.rtfd.org.QuickstartIncludedjango-session-activityin yourrequirements.txtfile.Addsession_activitytoINSTALLED_APPSand migrate/syncdb.Addsession_activity.middleware.SessionActivitytoMIDDLEWARE_CLASSESafter thedjango.contrib.sessions.middleware.SessionActivityMiddlewareanddjango.contrib.auth.middleware.AuthenticationMiddlewaremiddleware classes.Add url config for session list and sign-out views:url(r'^sessions/',include('session_activity.urls')),Then link to the main view using{% url "session_activity_list" %}template tag.Optionally copy & modify thesession_list.htmltemplate
to match your look and feel expectations.Dependenciesdjango-session-activitydepends ondjango>=1.5.0,django-appconf>=0.6andpython-dateutil.Licensedjango-session-activityis released under the MIT license.Other ResourcesGitHub repository -https://github.com/nigma/django-session-activityPyPi Package site -http://pypi.python.org/pypi/django-session-activityHistory0.1.0 (2014-01-23)First release
Package: django-session-cleanup
For projects that use thecached_dbordbsession engines, thedjango_sessiontable can get quite large after a while.Django provides the ‘cleanup’ management command for deleting expired sessions
from this table but you have to either run this command manually or
set-up a cron job.Django Session Cleanup provides a periodic task forCelerythat will delete expired sessions.UsageRunpip installdjango-session-cleanup.Addsession_cleanuptoINSTALLED_APPSin your project’s settings.Edit or createCELERYBEAT_SCHEDULEin your project’s settings:from session_cleanup.settings import weekly_schedule
CELERYBEAT_SCHEDULE = {
    ...
    'session_cleanup': weekly_schedule
}
Package: django-session-csrf
What is this?django-session-csrfis an alternative implementation of Django’s CSRF
protection that does not use cookies. Instead, it maintains the CSRF token on
the server using Django’s session backend. The csrf token must still be
included in all POST requests (either withcsrfmiddlewaretokenin the form or
with theX-CSRFTOKENheader).InstallationFrom PyPI:pip install django-session-csrfFrom github:git clone git://github.com/mozilla/django-session-csrf.gitReplacedjango.core.context_processors.csrfwithsession_csrf.context_processorin yourTEMPLATE_CONTEXT_PROCESSORS:TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'session_csrf.context_processor',
    ...
)Replacedjango.middleware.csrf.CsrfViewMiddlewarewithsession_csrf.CsrfMiddlewarein yourMIDDLEWARE_CLASSESand make sure it is listed after the AuthenticationMiddleware:MIDDLEWARE_CLASSES = (
    ...
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    ...
    'session_csrf.CsrfMiddleware',
    ...
)Then we have to monkeypatch Django to fix the@csrf_protectdecorator:import session_csrf
session_csrf.monkeypatch()Make sure that’s in something like your rooturls.pyso the patch gets
applied before your views are imported.Differences from Djangodjango-session-csrfdoes not assign CSRF tokens to anonymous users because
we don’t want to support a session for every anonymous user. Instead, views
that need anonymous forms can be decorated with@anonymous_csrf:from session_csrf import anonymous_csrf

@anonymous_csrf
def login(request):
    ...anonymous_csrfuses the cache to give anonymous users a lightweight
session. It sends a cookie to uniquely identify the user and stores the CSRF
token in the cache.  It can be controlled through these settings:ANON_COOKIEthe name used for the anonymous user’s cookieDefault:anoncsrfANON_TIMEOUTthe cache timeout (in seconds) to use for the anonymous CSRF tokensDefault:60 * 60 * 2  # 2 hoursNote that by default Django uses local-memory caching, which will not
work with anonymous CSRF if there is more than one web server thread.
To use anonymous CSRF, you must configure a cache that’s shared
between web server instances, such as Memcached.  See theDjango cache
documentationfor more information.If you only want a view to have CSRF protection for logged-in users, you can
use theanonymous_csrf_exemptdecorator. This could be useful if the
anonymous view is protected through a CAPTCHA, for example.from session_csrf import anonymous_csrf_exempt

@anonymous_csrf_exempt
def protected_in_another_way(request):
    ...If you want all views to have CSRF protection for anonymous users, use
the following setting:ANON_ALWAYSalways provide CSRF protection for anonymous usersDefault: FalseWhy do I want this?Your site is on a subdomain with other sites that are not under your
control, so cookies could come from anywhere.You’re worried about attackers using Flash to forge HTTP headers.You’re tired of requiring a Referer header.Why don’t I want this?Storing tokens in sessions means you have to hit your session store more
often.It’s a little bit more work to CSRF-protect forms for anonymous users.
Package: django-session-csrf-cookie
What is this?django-session-csrf-cookieis Django middleware that provides a
CSRF token cookie when usingdjango-session-csrf.  By design,
django-session-csrf does not require a CSRF token cookie, but such a
cookie is useful for AJAX requests and other web APIs, since it allows
the client to get the CSRF token without parsing HTML.  (Note that the
cookie is not used by the server for any purpose, so the security hole
django-session-csrf was designed to fix is still fixed.)InstallationFrom PyPI:pip install django-session-csrf-cookieFrom github:git clone git://github.com/trustcentric/django-session-csrf-cookie.gitAddsession_csrf_cookie.CsrfCookieMiddlewareto yourMIDDLEWARE_CLASSESbelowsession_csrf.CsrfMiddleware:MIDDLEWARE_CLASSES = (
    ...
    'session_csrf.CsrfMiddleware',
    'session_csrf_cookie.CsrfCookieMiddleware',
    ...
)Addsession_csrf_cookietoINSTALLED_APPS.Settingssession-csrf-cookie-middlewarecan be controlled using the
following settings:CSRF_COOKIE_NAMEThe name used for the CSRF token cookie.Default:csrftokenCSRF_COOKIE_DOMAINThe domain to be used when setting the CSRF cookie.Default: NoneCSRF_COOKIE_SECUREWhether to use a secure cookie for the CSRF cookie.Default: FalseCSRF_COOKIE_HTTPONLYWhether to set the HTTPOnly flag on the CSRF cookie.Default: False
Package: django-session-header
Django Session Header: Identify the session through a headerThere are some situations where the browser
may not allow any cookies at all to be used.
In those cases, we would like to be able to fall back
to something that is both secure, and capable.
This package allows you to manually pass the
sessionid using a header, so that you can continue
to use Django’s excellent session management.It extends Django’s built-in sessions to support
sessions in places where cookies are not allowed.
For most views, the handling will be seamless.
Those that need to have sessions that persist despite the
absence of cookies, there are a few extra features.UsageFirst, install the package.pipinstalldjango-session-headerReplacedjango.contrib.sessions.middleware.SessionMiddlewarein yoursettings.pywith the following:MIDDLEWARE_CLASSES=[# ...# 'django.contrib.session.middleware.SessionMiddleware','django_session_header.middleware.SessionMiddleware',]And replace the Django Rest FrameworkSessionAuthenticationclass withdjango_session_header.authentication.SessionAuthentication:REST_FRAMEWORK={'DEFAUlT_AUTHENTICATION_CLASSES':[# ...# 'rest_framework.authentication.SessionAuthentication','django_session_header.authentication.SessionAuthentication',]}If a session was obtained via a session header,
thenrequest.session.csrf_exemptwill beTrue.
You can use this to conditionally apply CSRF protection.
Or, if you prefer, you can replace Django’s normal CSRF middleware
withdjango_session_header.middleware.CsrfViewMiddleware:MIDDLEWARE_CLASSES=[# ...# 'django.middleware.csrf.CsrfViewMiddleware','django_session_header.middleware.CsrfViewMiddleware',]Thesessionidwill be available in theX-SessionIDresponse header,
and you can now set theX-SessionIDheader on the request manually
to avoid needing cookies to power your sessions.
Package: django-session-header-11
Django Session Header: Identify the session through a headerThere are some situations where the browser
may not allow any cookies at all to be used.
In those cases, we would like to be able to fall back
to something that is both secure, and capable.
This package allows you to manually pass the
sessionid using a header, so that you can continue
to use Django’s excellent session management.It extends Django’s built-in sessions to support
sessions in places where cookies are not allowed.
For most views, the handling will be seamless.
Those that need to have sessions that persist despite the
absence of cookies, there are a few extra features.UsageFirst, install the package.pipinstalldjango-session-headerReplacedjango.contrib.sessions.middleware.SessionMiddlewarein yoursettings.pywith the following:MIDDLEWARE_CLASSES=[# ...# 'django.contrib.session.middleware.SessionMiddleware','django_session_header.middleware.SessionMiddleware',]And replace the Django Rest FrameworkSessionAuthenticationclass withdjango_session_header.authentication.SessionAuthentication:REST_FRAMEWORK={'DEFAUlT_AUTHENTICATION_CLASSES':[# ...# 'rest_framework.authentication.SessionAuthentication','django_session_header.authentication.SessionAuthentication',]}If a session was obtained via a session header,
thenrequest.session.csrf_exemptwill beTrue.
You can use this to conditionally apply CSRF protection.
Or, if you prefer, you can replace Django’s normal CSRF middleware
withdjango_session_header.middleware.CsrfViewMiddleware:MIDDLEWARE_CLASSES=[# ...# 'django.middleware.csrf.CsrfViewMiddleware','django_session_header.middleware.CsrfViewMiddleware',]Thesessionidwill be available in theX-SessionIDresponse header,
and you can now set theX-SessionIDheader on the request manually
to avoid needing cookies to power your sessions.
Package: django-session-idle-timeout
# django-session-idle-timeoutA Django middleware application to timeout a logged in usersession after a specified time period.A django message will be issued if the session gets timed out.## RequirementsMake sure the following Django apps and middlewares are enabled:* Authentication (http://docs.djangoproject.com/en/dev/topics/auth/)* Sessions (http://docs.djangoproject.com/en/dev/topics/http/sessions/)* Messages framework (http://docs.djangoproject.com/en/dev/ref/contrib/messages/)```pythonINSTALLED_APPS += ('django.contrib.auth','django.contrib.sessions','django.contrib.messages',)``````pythonMIDDLEWARE_CLASSES += ('django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.contrib.messages.middleware.MessageMiddleware',)```## Installation instructionsInstall django-session-idle-timeout```basheasy_install django-session-idle-timeout```or```bashpip install django-session-idle-timeout```### Installed apps```pythonINSTALLED_APPS += ('django-session-idle-timeout',)```### Middleware```pythonMIDDLEWARE_CLASSES += ('django-session-idle-timeout.middleware.SessionIdleTimeout',)```### SettingsSESSION_IDLE_TIMEOUT defines the period after which the session gets timed out in seconds.The default value is 30min.```pythonSESSION_IDLE_TIMEOUT = 1800```## Keepalive PingKeeps the session alive as long as the browser window is opened using a javascript ping.### UrlsAdd to your urls.py e.g.:```pythonurlpatterns += (url(r'^django-session-idle-timeout/', include('django-session-idle-timeout.urls')),)```### TemplateLoad the keepalive template tag to start the javascript polling:```django{% session_keep_alive %}{% load session_keep_alive %}```## ImportantThis is a fork of http://github.com/subhranath/django-session-idle-timeout
Package: django-sessioninfo
# django-sessioninfo[![Build Status](https://travis-ci.org/arteria/django-sessioninfo.svg?branch=master)](https://travis-ci.org/arteria/django-sessioninfo)https://pypi.python.org/pypi/django-sessioninfohttps://github.com/arteria/django-sessioninfo## QuickstartRunpip install sessioninfoAdd‘sessioninfo’to yourINSTALLED_APPS.In order to activate the Session Admin, setSHOW_SESSIONS_IN_ADMIN=Truein your project settings.The management commandkill_sessionscan be used to log out all users at once.## FeaturesGive detailled info about the sessions of your users.Find users by session key (utils.get_session_user)Logging out users mechanism.History0.0.1 (1970-01-01)First release on PyPI.
Package: django-session-notifier
# django-session-notifier## Description
django-session-notifier is a simple package that displays a notification box in all views if the user is session authenticated.## Installation
* pip install django-session-notifier
* Add “djangosessionnotifier” to INSTALLED_APPS
* Add ‘djangosessionnotifier.middleware.NotifierMiddleware’ to MIDDLEWARE## To update package` python setup.py sdist twine upload dist/* `
Package: django-sessionprofile
Keep track of Django user sessions.django-sessionprofile is a library to track which user a django session belongs to.
Possible useful scenario’s for this information include:Single-Sign-On (SSO) between different applications that can read Django’s session
cookie (same-origin setup)Single Logout (SLO) initiated in another application, triggering logout in yoursAudit trail and security - allowing you to manage user sessions on other devices.Usage and installationCheat sheetpip installdjango-sessionprofileAdd"sessionprofile"to yourINSTALLED_APPSAdd"sessionprofile.middleware.SessionProfileMiddleware"to theMIDDLEWAREsetting, before Django’sSessionMiddlewarepython manage.py migrateFull instructionsSee thedocumentationfor more information, with more code-examples and context.CreditsMany thanks go to Resolver Systems Ltd (now part of PythonAnywhere) who
made the initial version of this library, specifically aimed at phpBB3.
Package: django-session-security
This app provides a mechanism to logout inactive authenticated users. An
inactive browser should be logged out automatically if the user left his
workstation, to protect sensitive data that may be displayed in the browser. It
may be useful for CRMs, intranets, and such projects.For example, if the user leaves for a coffee break, this app can force logout
after say 5 minutes of inactivity.Why not just set the session to expire after X minutes ?Or “Why does this app even exist” ? Here are the reasons:if the user session expires before the user is done reading a page: he will
have to login again.if the user session expires before the user is done filling a form: his work
will be lost, and he will have to login again, and probably yell at you, dear
django dev … at least I know I would !This app allows to short circuit those limitations in session expiry.How does it work ?When the user loads a page, SessionSecurity middleware will set the last
activity to now. The last activity is stored as datetime
inrequest.session['_session_security']. To avoid having the middleware
update that last activity datetime for a URL, add the url tosettings.SESSION_SECURITY_PASSIVE_URLS.When the user moves mouse, click, scroll or press a key, SessionSecurity will
save the DateTime as a JavaScript attribute. It will send the number of seconds
since when the last user activity was recorded to PingView, next time it should
ping.First, a warning should be shown aftersettings.SESSION_SECURITY_WARN_AFTERseconds. The warning displays a text like “Your session is about to expire,
move the mouse to extend it”.Before displaying this warning, SessionSecurity will upload the time since the
last client-side activity was recorded. The middleware will take it if it is
shorter than what it already has - ie. another more recent activity was
detected in another browser tab. The PingView will respond with the number of
seconds since the last activity - all browser tab included.If there was no other, more recent, activity recorded by the server: it will
show the warning. Otherwise it will update the last activity in javascript from
the PingView response.Same goes to expire aftersettings.SESSION_SECURITY_EXPIRE_AFTERseconds.
Javascript will first make an ajax request to PingView to ensure that another
more recent activity was not detected anywhere else - in any other browser tab.RequirementsPython 2.7 or 3.5+jQuery 1.7+Django 1.8 to 2.0django.contrib.staticfiles or #YoYoResourcesYou could subscribe to the mailing list ask questions or just be informed of
package updates.Git graciously hostedbyGitHub,Documentation graciously hostedbyRTFD,Package graciously hostedbyPyPi,Mailing list graciously hostedbyGoogleForSecurityissues, please contactyourlabs-security@googlegroups.comContinuous integration graciously hostedbyTravis-ci
Package: django-session-security-iplweb
This app provides a mechanism to logout inactive authenticated users. An
inactive browser should be logged out automatically if the user left his
workstation, to protect sensitive data that may be displayed in the browser. It
may be useful for CRMs, intranets, and such projects.For example, if the user leaves for a coffee break, this app can force logout
after say 5 minutes of inactivity.Why not just set the session to expire after X minutes ?Or “Why does this app even exist” ? Here are the reasons:if the user session expires before the user is done reading a page: he will
have to login again.if the user session expires before the user is done filling a form: his work
will be lost, and he will have to login again, and probably yell at you, dear
django dev … at least I know I would !This app allows to short circuit those limitations in session expiry.How does it work ?When the user loads a page, SessionSecurity middleware will set the last
activity to now. The last activity is stored as datetime
inrequest.session['_session_security']. To avoid having the middleware
update that last activity datetime for a URL, add the url tosettings.SESSION_SECURITY_PASSIVE_URLS.When the user moves mouse, click, scroll or press a key, SessionSecurity will
save the DateTime as a JavaScript attribute. It will send the number of seconds
since when the last user activity was recorded to PingView, next time it should
ping.First, a warning should be shown aftersettings.SESSION_SECURITY_WARN_AFTERseconds. The warning displays a text like “Your session is about to expire,
move the mouse to extend it”.Before displaying this warning, SessionSecurity will upload the time since the
last client-side activity was recorded. The middleware will take it if it is
shorter than what it already has - ie. another more recent activity was
detected in another browser tab. The PingView will respond with the number of
seconds since the last activity - all browser tab included.If there was no other, more recent, activity recorded by the server: it will
show the warning. Otherwise it will update the last activity in javascript from
the PingView response.Same goes to expire aftersettings.SESSION_SECURITY_EXPIRE_AFTERseconds.
Javascript will first make an ajax request to PingView to ensure that another
more recent activity was not detected anywhere else - in any other browser tab.RequirementsPython 2.7 or 3.5+jQuery 1.7+Django 1.8 to 2.0django.contrib.staticfiles or #YoYoResourcesYou could subscribe to the mailing list ask questions or just be informed of
package updates.Git graciously hostedbyGitHub,Documentation graciously hostedbyRTFD,Package graciously hostedbyPyPi,Mailing list graciously hostedbyGoogleForSecurityissues, please contactyourlabs-security@googlegroups.comContinuous integration graciously hostedbyTravis-ci
Package: django-session-timeout
django-session-timeoutAdd timestamp to sessions to expire them independentlyInstallationpipinstalldjango-session-timeoutUsageUpdate your settings to add the SessionTimeoutMiddleware:MIDDLEWARE_CLASSES=[# ...'django.contrib.sessions.middleware.SessionMiddleware','django_session_timeout.middleware.SessionTimeoutMiddleware',# ...]And also add theSESSION_EXPIRE_SECONDS:SESSION_EXPIRE_SECONDS=3600# 1 hourBy default, the session will expire X seconds after the start of the session.
To expire the session X seconds after thelast activity, use the following setting:SESSION_EXPIRE_AFTER_LAST_ACTIVITY=TrueBy default,last activiywill be grouped per second.
To group by different period use the following setting:SESSION_EXPIRE_AFTER_LAST_ACTIVITY_GRACE_PERIOD=60# group by minuteTo redirect to a custom URL define the following setting:SESSION_TIMEOUT_REDIRECT='your_redirect_url_here/'