Skip to main content
https://badge.fury.io/py/django-next-url-mixin.svg https://travis-ci.org/PetrDlouhy/django-next-url-mixin.svg?branch=master https://codecov.io/gh/PetrDlouhy/django-next-url-mixin/branch/master/graph/badge.svg

Next url mixin which is safe to phishing attacks

Naive implementation of the next URL mechanism is vulnerable to phishing attacks. This implementation aims to

  1. raise awareness of that

  2. provide safe implementation (possibly seen by more eyes)

The mixin does it’s work in form_valid() function, so it can be used for offspring of FormView or simillar view classes.

Documentation

The full documentation is at https://django-next-url-mixin.readthedocs.io.

Quickstart

Install Django next url mixin:

pip install django-next-url-mixin

Use it in your views:

from django.views.generic.edit import FormView
from next_url_mixin import NextUrlMixin

class MyView(NextUrlMixin, FormView):

    # If you are overriding form_valid(), don't forgot to return the super value with the redirect to the new url
    def form_valid(self, *args, **kwargs):
        return_value = super().form_valid(*args, **kwargs)
        return return_value

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

Tools used in rendering this package:

History

0.4.0 (2022-08-22)

  • Added support for Django 4.1

0.3.0 (2022-03-11)

  • Split mixin into GetNextPageMixin to allow usage of only get_next_page()

0.2.0 (2020-06-22)

  • Fix saving POST form

0.1.0 (2020-06-12)

  • First release on PyPI.

Release files for django-next-url-mixin 0.4.0

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-next-url-mixin 0.4.0
File Size Uploaded
django-next-url-mixin-0.4.0.tar.gz 18.8 kB Details

Release files / django-next-url-mixin-0.4.0.tar.gz

Download URL django-next-url-mixin-0.4.0.tar.gz
Size 18.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1763de5e454d7696c5816627bbd5a963eb57a417a26c4182fcfff8fe6c0bf500
BLAKE2b-256 checksum
How to use checksums
2de9abfa72b2db5f6c8a4473bb614f2a13253027d4bc79ae4f6e94f96fb9e4f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.4.0 This release

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.0

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