Skip to content
This repository has been archived by the owner on Oct 8, 2018. It is now read-only.

Latest commit

 

History

History
36 lines (24 loc) · 837 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 837 Bytes

Deprecated

This module has been replaced by canonicalwebteam.yaml-responses. You should use that instead.


Usage

Import this in urls.py and assign it to urlpatterns BEFORE custom urls. (redirects should be hit first) e.g:

from django_yaml_redirects import load_redirects

urlpatterns = load_redirects()
urlpatterns += patterns(...)

Format of redirects.yaml

The YAML format is simply key/value pairs, from source to destination:

# redirects.yaml

getubuntu/download_static: http://www.ubuntu.com/netbook/get-ubuntu/download

# Also supports regex:
testing/.+/alpha1/?:       https://wiki.ubuntu.com/QuantalQuetzal/TechnicalOverview/Alpha1

# And named groups
placeone/(?P<something>.+)/?: /place2/{something}