Skip to main content

like django.contrib.redirects on steroids. maybe.

Project description

django painless redirects
============

.. image:: https://travis-ci.org/bnzk/django-painless-redirects.svg
:target: https://travis-ci.org/bnzk/django-painless-redirects

like django.contrib.redirects, on steroids. maybe.

Implemented:

- simple redirects table, with that bit more flexibility / convenience
- limited wildcard matching
- move complete trees
- decide if you want to keep GET vars
- force site domain middleware, that redirects to current site's domain, if not already there

Yet to be done:

- APPEND_SLASH handling (when trying to redirect /whatever/was-here.html)
- contrib packages with "magic" redirects for django-cms, django-filer -> SEO is easy.


Installation & Usage
------------

To get the latest stable release from PyPi

.. code-block:: bash

pip install django-painless-redirects

Add ``painless_redirects`` to your ``INSTALLED_APPS``

.. code-block:: python

INSTALLED_APPS = (
...,
'painless_redirects',
)

Add the following middlware to MIDDLEWARE_CLASSES (1.10 style middlewares will be supported soon),
to make basic redirects work.

.. code-block:: bash

painless_redirects.middleware.ManualRedirectMiddleware

If you want to be redirected to the domain name entered in your current site (django.contrib.sites must be installed),
also add this middleware:

.. code-block:: bash
painless_redirects.middleware.ForceSiteDomainRedirectMiddleware


Development
------------

- there is test app, available with `./manage.py runserver`.
- to run tests: ./manage.py test
- to run tests with django 1.8 / 1.9 / 1.10: `tox`


Contributions
-------------

If you want to contribute to this project, please perform the following steps

.. code-block:: bash

# Fork this repository
# Clone your fork
mkvirtualenv django-painless-redirects
pip install -r test_requirements.txt
git checkout -b feature_branch
# Implement your feature and tests
git add . && git commit
git push -u origin feature_branch
# Send us a pull request for your feature branch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-painless-redirects-0.1.tar.gz (11.7 kB view hashes)

Uploaded Source

Built Distribution

django_painless_redirects-0.1-py2.py3-none-any.whl (20.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page