Skip to content

LowerDeez/ok-redirects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-ok-redirects PyPI version

Build status Code health Python versions PyPI downloads Software license Project Status

Simple Redirects App, which is particularly useful in the cases where you want to update some existing URLs without compromising your Website SEO.

Installation

Install with pip:

$ pip install django-ok-redirects

Update INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'ok_redirects',
    ...
]

Make migrations

$ python manage.py migrate

Available settings

REDIRECTS_IGNORE_PATH_PREFIXES - Tuple of path prefixes to ignore.

For example:

REDIRECTS_IGNORE_PATH_PREFIXES = (
    '/api/v1/',
    '/uploads/',
    '/static/',
)

Basic example to use:

Add the redirects middleware to the MIDDLEWARE configuration:

MIDDLEWARE = [
    ...

    'ok_redirects.middleware.RedirectMiddleware'
]

About

Simple redirects app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages