Skip to main content

simple_jquery_django_auto_logout

Requirements:

  • Django >=2.2,<4.0
  • Jquery
  • ✨ Coffee ✨

This is python package that make your web app autologout system look easier with minimal configurations Adapted FROM django-auto-logout package

Installation

pip install simple_jquery_django_auto_logout

Usage

Add This to your django settings.py

SIMPLE_AUTO_LOGOUT = {
    'AUTO_LOGOUT_IDLE_TIME' : timedelta(minutes=10),
    'AUTO_LOGOUT_MESSAGE' : 'Sesi Anda sudah habis, silahkan login kembali.',
    'AUTO_LOGOUT_URL' : 'app:logout',
}

Add this line to your context processor list

'simple_jquery_django_auto_logout.context_processors.auto_logout_context'

Add this to your base template or page that you want to activate auto logout

<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
{{ jquery_django_auto_logout }}

And you are DONE !!! Test your web app, it should be auto logout after several time you depend on your settings value above.

Note

If you want to add some message show while redirect to login page, you should use message framework from django https://docs.djangoproject.com/en/3.2/ref/contrib/messages/ and add some configuration in your logout URL like

@method_decorator(login_required(), name='dispatch')
class LogoutViews(View):
    def get(self, request):
        logout_message = request.GET.get('logout_message', None)
        if logout_message is not None:
            messages.info(request, logout_message)
        
        logout(request)
        return redirect(request.META['HTTP_REFERER'])

License

MIT

Free Software, Hell Yeah!

Metadata

Release files for simple-jquery-django-auto-logout 1.0.1

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

Source distribution (sdist)

Source distribution for simple-jquery-django-auto-logout 1.0.1
File Size Uploaded Provenance Actions
simple_jquery_django_auto_logout-1.0.1.tar.gz 4.3 kB Without provenance Details for simple_jquery_django_auto_logout-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-jquery-django-auto-logout 1.0.1
File Interpreter ABI Platform Actions
simple_jquery_django_auto_logout-1.0.1-py3-none-any.whl Python 3 none any Details for simple_jquery_django_auto_logout-1.0.1-py3-none-any.whl

Total release size: 9.4 kB

Release files / simple_jquery_django_auto_logout-1.0.1.tar.gz

Download URL simple_jquery_django_auto_logout-1.0.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b805d32f4542555991802291361bb9ba4f97c1609ce12fb5b3b7c1bb2e414db0
BLAKE2b-256 checksum
How to use checksums
d6ce65e9fb99d83c7d9e83580aa7dc6965a33822cd1ca03a58dc8ee4900378e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Release files / simple_jquery_django_auto_logout-1.0.1-py3-none-any.whl

Download URL simple_jquery_django_auto_logout-1.0.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ebf531c2d2d1afa55bb00656416a45dee092f60f458f2dbb06152dd886612549
BLAKE2b-256 checksum
How to use checksums
3a9c0fa275aaa226ef93d6aa9c69c345fd22b880de54489d2fab7fd28f030ed8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.0

Security for simple-jquery-django-auto-logout 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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