Skip to main content
Build Status

A Django application to store your previous history and action using differents backends.

With this application you will be able to redirect your users to their previous location when they tried to access a page where the login is required.

http://cl.ly/image/371E2R0L3n2h/backward_redirect.png

You will be also able to record previous action which needed login required.

For example, if your user is not logged in your application and try to execute an action which required authentication (e.g.: an user clicks on a button to follow another user), this application will record parameters (even on POST) and execute the last action when your user will be successfully logged.

http://cl.ly/image/3B2E0H2M0j1C/backward_action.png

Thanks to oleiade for the name.

Installation

  1. Either check out the package from GitHub or it pull from a release via PyPI

    pip install django-backward
  2. Add backward.middleware.BackwardMiddleware to your MIDDLEWARE_CLASSES

    MIDDLEWARE_CLASSES = (
        'backward.middleware.BackwardMiddleware',
    )
  3. Add backward.urls to your urls.py

    # urls.py
    
    from django.conf.urls import patterns, url, include
    
    urlpatterns = patterns(
        '',
    
        url(r'^backward/', include('backward.urls')),
    )
  4. Set settings.LOGIN_REDIRECT_URL as mentioned in your urls.py for example

    # settings.py
    
    LOGIN_REDIRECT_URL = '/backward/login/redirect/'
  5. Configure your Session engine if you are using the default backend

  6. Use the decorator backward.decorators.login_required if your views need authentication

Configuration

BACKEND_BACKEND_CLASS

The backend used to store information.

The default backend class is backward.backends.session.SessionBackend.

backwards.backends.session.SessionBackend

Store information in request.session using your Session engine

backwards.backends.session.CookieBackend

Store information in request.COOKIES, you can configure a few things:

  • BACKWARD_MAX_AGE: the age used to set an expiration date to the cookie

  • BACKWARD_COOKIE_DOMAIN: the domain name used for the cookie

  • BACKWARD_COOKIE_SECURE: if this is set to True, the cookie will be marked as secure, which means browsers may ensure that the cookie is only sent under an HTTPS connection.

Metadata

Release files for django-backward 0.3.6

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

Source distribution (sdist)

Source distribution for django-backward 0.3.6
File Size Uploaded
django-backward-0.3.6.tar.gz 7.9 kB Details

Release files / django-backward-0.3.6.tar.gz

Download URL django-backward-0.3.6.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
34899e6f98bb6db6fcaa1d4193752e11a5f51730983fb0d3735fd88764afb76d
BLAKE2b-256 checksum
How to use checksums
dbadd2cee58b310c00ab8a4093a48d74dbeb6123e5319b0afcd2564133149f1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.6 This release

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

1 release file

0.2.1

1 release file

0.2

1 release file

0.1

1 release file

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